jQWidgets Forums

jQuery UI Widgets Forums Grid setcellvalue issue

Tagged: ,

This topic contains 4 replies, has 2 voices, and was last updated by  DavidSimmons 12 years ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • setcellvalue issue #24033

    DavidSimmons
    Participant

    When editing a field in my grid, “Notes” every thing works great and my test alert show updateColumn and updateValue value correct!

    updaterow: function (rowid, rowdata, commit) {
    var updateID = rowid;
    var updateColumn = args.datafield;
    var updateValue = args.value;
    alert(updateID+’ ‘+updateColumn+’ ‘+updateValue);//******* Test *****

    },

    When editing the same field via the setcellvalue my test alert updateColumn and updateValue undefined!
    $(“#jqxGrid”).jqxGrid(‘setcellvalue’, 1, “Notes”, “New Value”);

    updaterow: function (rowid, rowdata, commit) {
    var updateID = rowid;
    var updateColumn = args.datafield;
    var updateValue = args.value;
    alert(updateID+’ ‘+updateColumn+’ ‘+updateValue);//******* Test *****

    },

    setcellvalue issue #24057

    Peter Stoev
    Keymaster

    Hi,

    The issue is not in the “setcellvalue” method. In the provided code the “args.datafield” is in the “updaterow” callback because there is no such parameter. There are 3 parameters which you can use in the “updaterow” and these are – rowID – row’s ID, rowData – the row’s data and commit – callback function which you need to call to either confirm or cancel the changes. “setcellvalue” works correctly.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    setcellvalue issue #24129

    DavidSimmons
    Participant

    I am using a little different update than normal because I update each cell as changed, not the complete record. To do this I need the RecordID , columnName and columnValue which I get from the rowid, args.datafield and args.value. If you test this it works and I got this information from someone jqWidgets. If there is a better way let me know and I will change my approach.

    updaterow: function (rowid, rowdata, commit) {
    var updateID = rowid;
    var updateColumn = args.datafield;
    var updateValue = args.value;
    alert(updateID + ‘ ‘ + updateColumn + ‘ ‘ + updateValue);
    //$.getScript(“../javascript/gridPDOUpdateRow.js”, function(){ gridUpdateRow(jqxgrid, rowid, updateID, updateColumn, updateValue, valueSelected, rowdata, commit, source.url); });
    },

    I guess the real question I should have asked is when using setcellvalue does it work the same as if you edited a cell’s value? If not is there a way to pass the commit=true or a way to have setcellvalue uses my a custom function?

    setcellvalue issue #24130

    Peter Stoev
    Keymaster

    Hi,

    “setcellvalue” is called by the Grid’s editor, too and the logic is the same. However, I should point again that args.datafield and args.value are not parameters of the “updaterow” and you shouldn’t base your logic on these.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    setcellvalue issue #24158

    DavidSimmons
    Participant

    Can you tell me a supported way during the updaterow I can get the ColumnName that was changed. I do not want to update the complete record for one cell….

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

You must be logged in to reply to this topic.