PDA

View Full Version : itemselector : disable drag and drop per value



terrychan04
8 Mar 2015, 11:13 PM
Hi All,

Since some records are mandatory which cannot be removed in right hand side of itemselector.

I am already handle in onRemoveBtnClick and onItemDblClick, but i have no idea to do it when user drag and drop records.

Regards
Terry

joel.watson
21 Mar 2015, 2:16 PM
Hi All,

Since some records are mandatory which cannot be removed in right hand side of itemselector.

I am already handle in onRemoveBtnClick and onItemDblClick, but i have no idea to do it when user drag and drop records.

Regards
Terry

One way you could do this would be to add a "beforedrop" handler to the dropZone on the "fromField" of the itemselector component. Within that handler, you could do whatever processing necessary to determine if the drop is allowed, and if it isn't, you could return false and cancel the drop. I've included an example below.

Thanks!
Joel

k26