fires before selection of an item is started
id | string|number | id of the item |
state | boolean | the selected state of the item (true when item is selected by action) |
boolean | true - to trigger the default action, false - to block it |
myList.attachEvent("onBeforeSelect", function (id, state){
// your code here
return true;
});
The event is blockable, returning false will block the default action.
In case of multi-select, the event fires only for items which were clicked, and it doesn't fire for the items which were selected by Shift-click or similar actions.
Back to top