EasyUI Forum
September 16, 2025, 11:48:39 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Mobile - Check page before moving to another  (Read 7215 times)
garnold
Newbie
*
Posts: 11


View Profile
« on: October 20, 2016, 11:53:54 AM »

I have a button that has onclick="$.mobile.go('#p3')" setup. I would like the have a datalist checked for a selection before the page is changed. How is this done please? Thank you.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: October 20, 2016, 08:14:41 PM »

Call 'getChecked' method to detect if some rows are checked.
Code:
var checkedRows = $('#dl').datalist('getChecked');
if (checkedRows.length){
  $.mobile.go('#p3');
}
Logged
garnold
Newbie
*
Posts: 11


View Profile
« Reply #2 on: October 21, 2016, 06:05:32 AM »

Call 'getChecked' method to detect if some rows are checked.
Code:
var checkedRows = $('#dl').datalist('getChecked');
if (checkedRows.length){
  $.mobile.go('#p3');
}

So is it best to just create small sub functions and assign them to these buttons?
Logged
garnold
Newbie
*
Posts: 11


View Profile
« Reply #3 on: October 21, 2016, 06:29:27 AM »

Call 'getChecked' method to detect if some rows are checked.
Code:
var checkedRows = $('#dl').datalist('getChecked');
if (checkedRows.length){
  $.mobile.go('#p3');
}

Actually this ended up working quite well. Thank you for the help ;-)

$('#menuBtnSendWrap').bind('click', function(){
        var checkedRows = $('#dlWraps').datalist('getChecked');
      if (checkedRows.length){
        $.mobile.go('#p3');
      }else{
         $('#dlgAlertMsg').html("Choose a wrap!");
         $('#dlgAlert').dialog('open').dialog('center');
      }
    });
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!