Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Don on Oct 30, 2008 01:36
open dhtmlx forum
Stop duplicates in target grid when draging multipule items from another grid

I have two identical grid structures.
I am dragging multipule selected items from grid 1 into grid 2.

Q: How can I stop duplicate items from ending up in grid 2 without stopping the other selected data from being added?

Answer posted by Support on Oct 30, 2008 03:47
You can attach custom code to the onDrag event, which will get list of draged items ( incoming parameter ) , check which of them not exist in target grid (grid.getRowById returns null for not existing rows), after that execute moveRow ( or moveRowTo ) command against all rows , which need to be moved and return false to block original d-n-d action. 

As result the d-n-d will be blocked, but necessary rows moved ( by moveRow calls )