4

I am facing an issue with jQuery Mobile on iPhone.

I have a list of checboxes and a checkbox to select "All".

After an initial few taps on the checkbox, the check box takes few seconds to get marked as checked/unchecked.

The checkbox doesnt get marked unless the user waits for a few seconds or scroll the screen.

This seems to be an issue only with this particular phone as it works fine on desktop browsers and Android devices.

Here is the script:

/* Check-Uncheck */
self.elements.listview.on('change', ':checkbox', function (event) {
  var unchecked = $(':checkbox:not(:checked)', self.elements.listview);
  self.elements.selectAll
  .prop('checked', unchecked.length === 0)
  .checkboxradio("refresh");
});


/* Check-Uncheck 'Select All' */
self.elements.selectAll.change(function () {
  var checkboxes = $(':checkbox', self.elements.listview);
  var checked = self.elements.selectAll.is(':checked');
  checkboxes
  .prop('checked', checked)
  .checkboxradio("refresh");
});    

Please let me know if anyone has faced this particular issue, or have any suggestions.

Thanks

Vijeth
  • 184
  • 8
  • Experiencing the same issue on iOS. – AJ. Dec 27 '13 at 08:12
  • Same on Windows Phone 8 too – Mithun Sreedharan Mar 18 '14 at 11:57
  • It sounds like you need to strip back your query to see what is causing the lag. It can only be down to something using up resources. This only becomes evident on phones as they are less powerful than a dev PC. In my experience the issue is with the same bit of code being called multiple times. So it can be tricky to identify unless their is a physical evidence of the code being run multiple times eg some HTML being added multiple times. Strip your code back and build it back up piece by piece and test it on the device where you've been seeing the issues. – Phill Healey Apr 21 '14 at 20:40
  • I tried with different logic for looping but the issue still persists. Then I came across some articles which talk abt the respose lag in JQM pages with large listviews. Seems to be an valid issue with low end phones and iPhones with older versions of iOS. Can read abt it here [link](http://blog.jquerymobile.com/page/3/) , under "Key Changes" – Vijeth May 14 '14 at 07:09
  • It Could be the 300 millisecond delay on ios devices. You can try a jquery plugging called fastclick to eliminate the delay. I haven't try it yet myself --- you can check this Article/Question --- http://stackoverflow.com/questions/12238587/eliminate-300ms-delay-on-click-events-in-mobile-safari – Tasos May 27 '14 at 23:09

0 Answers0