Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on May 22, 2007 13:05
open dhtmlx forum
Method to determine the row editing is over?

Hi support,

I have a sortable grid table I am using inline editing for  updating a row (record) assume that I have 4 fields I want to initiate an Ajax call when I enter/change data in my field or there need not be a predefined order for entering/changing data the user may start from any columns but the Ajax method must be invoked only if they've completed the row changes. How I can do this?

Regards

Mahesh
Answer posted on May 22, 2007 13:35
You can use onCellChanged or onEditCell events to catch moment when cell was changed.
mygrid.attachEvent("onEditCell",function(stage,rowid,cellIndex){
    if (stage==2){
       //edit finished
       //any custom code here
    }
});

>>but the Ajax method must be invoked only if they've completed the row changes
this scenario is bit more complex , the grid itself doesn't monitor changes for row, you can use approach described above and monitor when all necessary rows would be changed
or use something similar to next

mygrid.attachEvent("onEditCell",function(stage,rowid,cellIndex){
    if (stage==2){
       //edit finished
       var all_changed=true;
    all_changed|=this.cell(rowId,INDEX1).wasChanged();
    all_changed|=this.cell(rowId,INDEX2).wasChanged();
    all_changed|=this.cell(rowId,INDEX3).wasChanged();
   
    if ( all_changed) do_ajax_call();

    }
});

wasChanged flag established after user change any value in cell.
Answer posted by Darya (Support) on Dec 10, 2014 01:02

Having solved the problem mentioned above, you may also look through the possible related problems with javascript mobile framework and date picker script.