How can I get the DataProcessor to pass the rowIndex of the

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


>>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);

}