Tuesday, April 5, 2011

jQuery UI checkbox button select all problem.

I am using this to check all checkboxes.

<input type="checkbox" id="all" onclick="$('input[name*=\'selected\']').attr('checked', checked);" />

as long as I use the normal checkboxes everything works fine. When I convert all to jQuery UI checkboxes: http://jqueryui.com/demos/button/#checkbox They get checked -- but not in a visually -- the colors are not changing. I saw that when a jQuery UI checkbox is checked it gets this attribute aria-pressed="true"

Can someone help me understand how can I get this done!

From stackoverflow
  • There a refresh method to update the visual style after you change the checked value programmatically, like this:

    $('input[name*=\'selected\']').attr('checked', checked).button("refresh")
    
    ciprian : by some unknow (by me) reason this doesn't work :(

0 comments:

Post a Comment