JQuery UI select button selects the whole problem

I use this to check all the checkboxes.

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

as long as I use regular checkboxes everything works fine. When I convert everything to jQuery UI flags: http://jqueryui.com/demos/button/#checkbox They are checked, but not visually - the colors do not change. I saw that when the jQuery UI checkbox is checked, it gets this attributearia-pressed="true"

Can someone help me figure out how I can do this!

+3
source share
2 answers
$('input[name*=\'selected\']').attr('checked', true).button("refresh");

Very easy:

  • Install the base radio
  • Flip the state on the front of the jQuery UI button
+4
source

refresh method checked , :

$('input[name*=\'selected\']').attr('checked', checked).button("refresh")
+2

Source: https://habr.com/ru/post/1768718/


All Articles