I have a list of items. I need to select an item or multiple items by pressing Shift key or Control key.
JSBIN → Link
My doubt is how to get the current clicked elements model in my View. If I can get the current clicked elements model I can trigger my action handler method to manipulate my model. Also the event object is not available directly in my action handler in the Route.
Two Points I am not clear:
How to get the current clicked elements model in the View.
Thanks for your reply. I am able to select the items with shift key pressed. Also need to select the item on Control key press and right click.
When I give allowdedKeys=“shift control”, then on control/command key press the action is not triggered. Is there any other key name to specify for command key in Mac.
Also I need to select the item on right click ( contextmenu ), I tried giving on=“click contextmenu”, but it was not working.
@jhsu I got an issue in the above implementation. When I select the list in my view the index model is not updated. I need to maintain the selection state in my global index model.
After selection is done I need to get the selected list of items. So I have made some changes to the code. I could not reset all the selected items and the global index model.