Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
0
Check/Uncheck Select All header checkbox using jquery
posted

Hi,

i wanted to check or uncheck  SelectAll header checkbox on specific condition. so how can i check do that programmatically.

I found some workaround to do it programmatically.

$('#ig1').find('[name="hchk"]').data("chk","off").find("span").removeClass( "ui-igcheckbox-normal-off" ).addClass( "ui-igcheckbox-normal-off" );

but above work around fail when checkbox clicked and checked previously and using above code i unchecked it and then clicked to checked that time it actually perform deselection of rows but it must perform Selection of all rows.

Parents
No Data
Reply
  • 0
    Offline posted

    jQuery is() method is to check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. If no element fits, or the selector is not valid, then the response will be 'false'. This method traverses along the DOM elements to find a match, which satisfies the passed parameter.


    if ($("input[type=checkbox]").is(":checked")) {
    alert("Checked");
    }

Children
No Data