Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Zev on Feb 27, 2009 09:19
open dhtmlx forum
Updating Grid with jsarray data after return from AJAX call

I am using the Pro version.

I have loaded my data via jsarray and I am using all custom rendered cells. Since the grid does not persist the jsarray per cell, i store it so that I can have access to it as needed later on. One of the cells has a checkbox. When it loads, the id=0. After it is checked, i maintain a hash that holds that value as true for the checkbox in the cell. When i click Save, i send the hash data to the server for persistence. If a record is inserted, a PK is created and i need that to be returned and updated for that specific checkbox (so id=PK) and updated within the grid. THe data returned has the cell id and row that the checkbox resides in.

Question:

What is the best way to update the PK for the checkbox? If i send jsarray JUST for that row, can the parse command be called for a specific row? Is there a better way to kick off the cell renders? Just I just do it in straight JS? Do you have any suggestions?

Thanks,
Zev.
Answer posted by Support on Mar 02, 2009 07:03
>>can the parse command be called for a specific row
Not directly , but you can use 
grid._fillRow(grid.getRowById(id),data);
where data -js array of data for the row
Command will reset all data in row , from provided js array

>>Just I just do it in straight JS? Do you have any suggestions?
If you need to change a value of some specific cell, you can use
          grid.cells(id,ind).setValue(any_new_value);