TreeGrid onDrag dataprocessor behaviour for move

I’ve been trying to set the on drop process to update the parent_id so that the row ID stays the same as there are other tables pointing to it.

The current method deletes and inserts a new row, but on the dhtmlxTree it will move it by updating the parent ID.

I have noticed reference to a different dtaprocessor javascript file with this method of updating, is there somewhere I can get this (for pro suite V2.6), or is there another way?

Thanks,

Jason

I’ve been trying to set the on drop process to update the parent_id so that the row ID stays the same as there are other tables pointing to it.
Each row in TreeGrid, Grid or Tree must have unique id

The current method deletes and inserts a new row, but on the dhtmlxTree it will move it by updating the parent ID.
Unfortunately it’s not clear how this issue may occurs. When you drop item to child position, id of parent row is not changed.

I have noticed reference to a different dtaprocessor javascript file with this method of updating, is there somewhere I can get this (for pro suite V2.6), or is there another way?
At which example did you notice this reference?

HI Olga,

Thanks for your reply.

I’m trying to preserve the unique id of the row which has been dragged and dropped (moved) in either child or sibling mode.

In tree movement can be performed by updaing the parent_id of the item (dataprocessor calls update of moved row.) but in TreeGrid the moved row is deleted and then inserted, is there any way of changing this behaviour (in the dp).

I saw in another post, by Stanislav I think, but from around 2007/8 where he refers to a different version of dataprocessor.js which is modified to do this, but I can’t seem to find the post again I’m afraid.

I have been trying to use the dp.ignore() function to execute the onDrag move, then update the row’s parent_ID value with an ajax call, is there a better way, as I’m struggling a bit!

Kind Regards,

Jason

In case of latest grid and dataprocessor. Using

dp.setUpdateMode( some, true );

must force TreeGrid to use updated for dnd operations.
In background it still adds and deletes the rows, but status of dataprocessor will be update and id of item will be preserved. ( move operations, inside the same TreeGrid only )

Hi Stanislav, that’s exactly what I’m looking for! many thanks, but…

at risk of sounding stupid… what is some?

I’m moving rows in a treegrid (called mygrid)? or should I use it on the onDrag function with the row ID?

Thanks for your patience!

Jason

First parameter if setUpdateMode() method could be:
“row” - based on row selection changed (data will be send to the server side after you select the row),
“cell” - based on cell editing finished (data will be send to the server side after you edit cell),
“off” - manual data sending (data will be send to the server side after you call dp.sendData() method)

Many thanks both, simply by using dp.setUpdateMode(“cell”, true); I can use the connector and dataprocessor as normal and it preservers the unique id of the row.

thanks,

Jason