Slowly getting to know SmartGWT the questions keep arising (I hope someone will have the time to write at manual some day).
I'm trying to add drag'n'drop reordering on a TreeGrid. I've called setCanReorderRecords(true) + setDragDataAction(DragDataAction.MOVE) and everything is looking fine.
I'm using a custom DataSource based on the GwtRpcDataSource described elsewhere in this forum.
After dragging a node, my DataSource is called (update) and now I assume I need to tell the server that the 'order' field of two or more records has changed. But how do I know what has happened? The update request itself doesn't seem to carry that information?
I tried adding a FolderDropHandler to the TreeGrid to determine what is happening. Then I guess I would update the 'order' field on all affected records, so that the update in it's turn would know what to do.
But I'm still not sure exactly what has happend in the event. I get the new index of the node, but how do I know which record is beeing moved?
I tried calling folderDropEvent.getNodes() but this results in a ClassCastExecption : ListGridRecord cannot be cast to TreeNode?!
It feels like I'm working agains the framework here. So could someone please tell me what the correct approach is?
Thanks in advance,
Christian
P.S. I have tried to find the answer on the forum, but can't seem to.
I'm trying to add drag'n'drop reordering on a TreeGrid. I've called setCanReorderRecords(true) + setDragDataAction(DragDataAction.MOVE) and everything is looking fine.
I'm using a custom DataSource based on the GwtRpcDataSource described elsewhere in this forum.
After dragging a node, my DataSource is called (update) and now I assume I need to tell the server that the 'order' field of two or more records has changed. But how do I know what has happened? The update request itself doesn't seem to carry that information?
I tried adding a FolderDropHandler to the TreeGrid to determine what is happening. Then I guess I would update the 'order' field on all affected records, so that the update in it's turn would know what to do.
But I'm still not sure exactly what has happend in the event. I get the new index of the node, but how do I know which record is beeing moved?
I tried calling folderDropEvent.getNodes() but this results in a ClassCastExecption : ListGridRecord cannot be cast to TreeNode?!
It feels like I'm working agains the framework here. So could someone please tell me what the correct approach is?
Thanks in advance,
Christian
P.S. I have tried to find the answer on the forum, but can't seem to.
Comment