Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How to modify field values programatically before saving using saveAllEdits()

    Hi, I am using SmartClient Version 11.0p build 2016-12-25 Enterprise edition.
    I am looking for the way I change some values in a ListGrid before saving using saveAllEdits();
    For example, I want to change a field say "Time_elapsed" in a ListGrid to some value which users don't provide/enter.

    I have tried this in a save button. I have successfully saved. However, I found there are 2 RPC requests per 1 change which I think I am not doing it proper way.
    Can anybody enlighten me with the proper way???
    ----------------------
    click: function(){
    var editrows = theListGrid.getAllEditRows();
    if (editrows.length == 0 ) return;
    for (i=0;i<editrows.length;i++) {
    if (record != null ) {
    record.time_elapsed = global_var.time_elapsed;
    theListGrid.updateData(record);
    }

    }
    theListGrid.saveAllEdits();
    }
    -----------------------------------

    #2
    See the Grid Editing overview. You can use editValues to programmatically define changes that should be saved along with user changes.

    Comment

    Working...
    X