jQuery UI Widgets Forums DataTable UpdateRow Commit Problem

This topic contains 3 replies, has 3 voices, and was last updated by  Dimitar 4 years ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • UpdateRow Commit Problem #68729

    drtzack
    Participant
    
            updaterow: function (rowID, rowData, commit) {
                $.ajax({
                    type: "POST",
                    dataType: 'json',
                    cache: false,
                    async: false,
                    url: '/api/order/update',
                    data: rowData,
                    success: function (data, status, xhr) {
                        commit(true);
                    }
                });
            },
    

    Here is my code. if I set async to true, it’s not showing the changes unless I refresh the page.

    UpdateRow Commit Problem #68789

    Dimitar
    Participant

    Hello drtzack,

    Note that the name of the data table source callback is updateRow, not updaterow. Please correct this and share if the issue persists.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    UpdateRow Commit Problem #85933

    edd
    Participant

    Can anybody help me to with what i need to write to get on server the add edit reset row ?

    updaterow: function (rowid, rowdata, commit) {
    //synchroniza with the server – send update command
    data = “update=true” +
    “&ID_CUSTOMERS=” + rowdata.ID_CUSTOMERS +
    “&CompanyName=” + rowdata.CompanyName +
    “&ContactTitle=” + rowdata.ContactTitle +
    “&City=” + rowdata.City +
    “&Country=” + rowdata.Country +
    “&Address=” + rowdata.Address +
    “&DateOfBirth=” + rowdata.DateOfBirth;
    //rowdata.id = rowid;

    $.ajax({
    dataType: ‘json’,
    //cache: false,
    url: ‘WebService1.asmx/GetCustomers’,
    data: rowdata,
    type: “POST”,
    success: function (data, status, xhr) {
    // update command is executed.
    commit(true);
    //commit(true, data.id);
    alert(‘Worked!’);
    },
    error: function (jqXHR, textStatus, errorThrown) {
    // update failed.
    commit(false);
    alert(‘Did not work’);
    commit(true);
    }
    });

    },
    addrow : function (rowid, rowdata) {
    var observableArray = self.myData.arrayA,
    record = null;
    observableArray.push({ dateFrom: null, dateTo: null, duration: null, text: null, code: null, currency: null });
    record = observableArray()[rowid];
    for (var obj in record) {
    record[obj] = ko.observable(record[obj]);
    }
    ko.mapping.fromJS(observableArray(), {}, self.myData.arrayA());
    }

    deleterow : function (rowid) {
    var observableArray = self.myData.arrayA;
    observableArray.remove(observableArray()[rowid]);
    }

    I need to write anything else on default.aspx.cs to can see on the server sql?

    • This reply was modified 4 years ago by  edd.
    UpdateRow Commit Problem #85961

    Dimitar
    Participant

    Hello edd,

    Please note my previous post in this topic. If you are using jqxDataTable, the source callback functions in question are called updateRow, addRow and deleteRow. Please also note that there has to be a comma between the definitions of addRow and deleteRow.

    You can see a working CRUD example (but with jqxGrid) that features both client- and server-side implementations here: http://www.jqwidgets.com/jquery-widgets-documentation/documentation/asp.net-integration/asp.net-grid-crud.htm.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.