This topic contains 3 replies, has 2 voices, and was last updated by Hristo 7 years, 1 month ago.
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.
jQuery UI Widgets › Forums › Lists › ListBox › Select all and items on checkbox click
Tagged: Angular listbox, bootstrap listbox, javascript listbox, jQuery ListBox, jqwidgets listbox, jqxListBox
This topic contains 3 replies, has 2 voices, and was last updated by Hristo 7 years, 1 month ago.
hi,
How to select all items on check box click and unselect all items on uncheck check box.
If checkbox=True than select all listbox items
else unselect all listbox items
$(“#SelectAllCompanies”).on(‘change’, function (event) {
var checked = $(‘#SelectAllCompanies’).jqxCheckBox(‘checked’);
if(checked){
var items = $(“#CompaniesList”).jqxListBox(‘getSelectedItems’);
for (var i = 0; i < items.length; i++) {
$(“#CompaniesList”).jqxListBox(‘selectIndex’, i);
}
}
else{
for (var i = 0; i < items.length; i++) {
$(“#CompaniesList”).jqxListBox(‘unselectIndex’, i);
}
}
});
Thanks in advance…
Hello zakstev,
Try to use checkChange event and getSelectedItems method.
Best Regards,
Hristo Hristov
jQWidgets team
http://www.jqwidgets.com
hi,
checkChange event is not working, please check.
$(“#SelectAllCompanies”).on(‘checkChange’, function (event) {
alert(“Test”);
});
Thanks…
Regards,
MZ
Hello zakstev,
Please take a look this example:
http://jsfiddle.net/txhi/t54xfo48/
Best Regards,
Hristo Hristov
jQWidgets team
http://www.jqwidgets.com
You must be logged in to reply to this topic.