jQuery UI Widgets › Forums › Grid › Select all event
Tagged: angular grid, checkbox, grid, jquery grid, jqxgrid, select all, select all event
This topic contains 5 replies, has 3 voices, and was last updated by heer 6 years, 2 months ago.
-
AuthorSelect all event Posts
-
Hi, how can I get “select all” event, when the grid in ‘checkbox’ selection mode and “select all” checkbox is clicked?
Thanks.
UPD, actually, my grid works in virtual mode, and I need to select all rows only on current page by clicking “select all” checkbox
Hello aser,
Here are two possible implementations of a “select all” event:
- http://jsfiddle.net/Dimitar_jQWidgets/drvo3mL0/
- http://www.jqwidgets.com/community/topic/event-on-click-of-select-all/#post-55030
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Any ideas on how to implement the “unselect all”-event? The rowunselect-event does not fire when unselecting all rows by clicking the header-checkbox.
Thanks in advance // Henrik
Solved:
The events “rowselect” and “rowunselect” does not really work as expected:
rowselect fires
1. When a row is selected
2. When all rows are selected by clicking the “select-all-checkbox”
3. When all rows are UNselected by clicking the “select-all-checkbox”.rowunselect fires
1. When a row is unselected
Note: rowunselect does NOT fire when all rows are unselected using the “select-all-checkbox”.Solution (using an un-documented feature):
In the case “rowselect” was fired when clicking the “select-all-chenbox” the event-argument event.args.rowindex of the handler holds an array of indexes to the selected rows. i.e. an array of all indexes OR an empty array. By checking the length of the array you will know!Example:
$("#theGrid").bind('rowselect', function (event) { if (Array.isArray(event.args.rowindex)) { if (event.args.rowindex.length > 0) { alert("All rows selected"); } else { alert("All rows unselected"); } } else { alert("Selected row has index = " + event.args.rowindex); } }); $("#theGrid").bind('rowunselect', function (event) { alert("Unselected row has index = " + event.args.rowindex); });
-
AuthorPosts
You must be logged in to reply to this topic.