Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Andrew on May 15, 2008 13:39
open dhtmlx forum
How can I get the DataProcessor to pass the rowIndex of the TreeGrid row it is updating?

We allow the users of our application to move rows, in the TreeGrid, up and down. We would like to persist the order of the rows when we do a POST. So, how can I get the DataProcessor to pass the rowIndex of the TreeGrid row it is updating?

Looking at the parameters that are set I see

Request parameters : gr_id value : 402 which is the grid rowID
Request parameters : gr_pid value : 401 which, I believe, is the grid row parentId

It seems like I need to do something like this:
rowIndex = getRowIndex(gr_id)

Will that work? If so how do I get the DataProcessor to pass that back to the server?

Thanks,

Andrew
Answer posted by Support on May 16, 2008 01:55

>>Will that work? If so how do I get the DataProcessor to pass that back to the server?
The rowIndex is pretty flexible parameter, it can be changed by lot of different operations ( for example sorting will change indexes of all rows in grid )

By default dataProcessor doesn't sent such information to server side but you can change default logic, by next code modification

dhtmlxdataprocessor.js , line 414

str+="&"+pref+"gr_pid="+this.escape(this.obj.getParentId(rowId));

can be rewritten as

{
     str+="&"+pref+"gr_pid="+this.escape(this.obj.getParentId(rowId));
     str+="&"+pref+"gr_index="+this.escape(this.obj._h2.get[rowId].index);

}