SmartClient Version: v9.1p_2015-09-16/Pro Development Only (built 2015-09-16)
Google Chrome version 46
I am working with isc.Menu component and would like re-ordering capabilities using the drag-and-drop feature.
The example code below consists of a menu with “Sticky” menu items that are not draggable. I would like so that the moveable items cannot move the current first or second-last/last menu item. (i.e., No menu item can drop above “Sticky 1” or below/above “Sticky 2”. Using “canAcceptDrop” property works well for “Sticky 1” menu item. However, using the same property for the last item on the list does not allow the same functionality. The moveable menu items are still able to be dropped below “Sticky 2”, hence, the last menu item has changed. Is this a bug with canAcceptDrop for the last menu item on a isc.Menu?
If there is no solution for the above question, is there a way to prevent the component from dropping if the target drop index is at a specific position? This would ensure that items do not lose their position when re-ordering.
Google Chrome version 46
I am working with isc.Menu component and would like re-ordering capabilities using the drag-and-drop feature.
The example code below consists of a menu with “Sticky” menu items that are not draggable. I would like so that the moveable items cannot move the current first or second-last/last menu item. (i.e., No menu item can drop above “Sticky 1” or below/above “Sticky 2”. Using “canAcceptDrop” property works well for “Sticky 1” menu item. However, using the same property for the last item on the list does not allow the same functionality. The moveable menu items are still able to be dropped below “Sticky 2”, hence, the last menu item has changed. Is this a bug with canAcceptDrop for the last menu item on a isc.Menu?
If there is no solution for the above question, is there a way to prevent the component from dropping if the target drop index is at a specific position? This would ensure that items do not lose their position when re-ordering.
Code:
isc.MenuButton.create({ [B]menu[/B]: isc.Menu.create({ [B]canReorderRecords[/B] : true, [B]selectionType[/B]: "single", [B]dragDataAction[/B]: "move", [B]data[/B]: [{[B]title[/B]: "Sticky 1", [B]canDrag[/B]: false, [B]canAcceptDrop[/B]: false},{[B]title[/B]: "Moveable 1"}, {[B]title[/B]: "Moveable 2"},{[B]isSeparator[/B]: true, [B]canAcceptDrop[/B]: false}, {[B]title[/B]: "Sticky 2", [B]canDrag[/B]: false, [B]canAcceptDrop[/B]: false}] }) });
Comment