ishani modi
Posts: 0
Joined: Wed Oct 23, 2013 4:49 am

On Toggle checkboxes select/deselect.

Hi,

I have used toggle component and on toggle "on" i want all checked boxes checked.
Checkboxes are binding dynamically from JSON

Thanks,
Ishani

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

On Toggle checkboxes select/deselect.

Hello! You need to retrieve all checkboxes with jquery and make them checked. After that refresh component
pre$("yourSelectorHere").find("input").prop("checked", true).checkboxradio("refresh");/prewhere yourSelectorHere -your selector to retrieve needed checkbox.

ishani modi
Posts: 0
Joined: Wed Oct 23, 2013 4:49 am

On Toggle checkboxes select/deselect.

hi i used this code,

$("input[type='checkbox']", $.mobile.activePage).each(
function(){
this.checked = true;
})
Step 1:
On toggle on checkboxes are getting true i saw in backend. but it is not display in checked. so which css should i apply ?

Image

Step 2:
after click any of the check boxes, then it is showing me all other checkboxes to true which is corrct Image

So in step 1 which css should i apply ? which code should i write so that its shows me checkbox checked

ishani modi
Posts: 0
Joined: Wed Oct 23, 2013 4:49 am

On Toggle checkboxes select/deselect.

the code you shown didnt work

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

On Toggle checkboxes select/deselect.

Hi Ishani,

You forget to refresh a component. See the above code Marina posted:pre.checkboxradio("refresh")/pre

ishani modi
Posts: 0
Joined: Wed Oct 23, 2013 4:49 am

On Toggle checkboxes select/deselect.

Hi katya,
I already used that code but it is not working.
I have used checkbox inside list component.

ishani modi
Posts: 0
Joined: Wed Oct 23, 2013 4:49 am

On Toggle checkboxes select/deselect.

hi, its working now, i was not refreshing the checkboxes . :)

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

On Toggle checkboxes select/deselect.

Hi Ishani,

Thank you for the update!

Return to “Issues”