Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Mikkel on Jan 24, 2008 17:39
open dhtmlx forum
How to know when myDataProcessor.sendData() has finished updating?

Hello there,

I have a page with a datagrid and when user clicks the save button, I want to navigate to another page.

It seems that if I add a lot of rows and click save, the datagrid only manages to update a few rows before the page navigates to some other page.

I have tried this:

function saveDataGrid()
{
if(myDataProcessor.sendData())
return true;
else
return false;
}

But it seems like the script doesn't wait for sendData() to complete...
Answer posted by Support on Jan 25, 2008 02:45
dataProcessor sends data by async. calls, it useful when you saving data in background, but may cause problem in situation similar to yours.
Please try to use code similar to next

    myDataProcessor.setOnAfterUpdate(function(){
          if (myDataProcessor.getSyncState()){
                   //any code which need be called when all data saved
          }
    })
    myDataProcessor.sendData()