DataTable Mobile Regex Filter with Checkbox

DataTable Mobile Regex Filter with Checkbox

blu3c4ndyblu3c4ndy Posts: 1Questions: 0Answers: 0
edited August 2017 in Free community support

i have a problem.Checkbox filters are working on desktop browsers.But mobile browsers are not working.Html and Js code is here:

function filterColumn ( i ) {
    $('#bookings').DataTable().column( i ).search(
        $('#col'+i+'_filter').val(),
        $('#col'+i+'_regex').prop('checked'),
        $('#col'+i+'_smart').prop('checked'),
    ).draw();
}
 
$(document).ready(function() {
    $('#bookings').DataTable();
    
    $(document).on("click", "#record-filters", function() {
        
        var checkboxes = document.getElementsByName('GridDisplay');
      var voltran = [];
      var selected = [];
      for (var i=0; i<checkboxes.length; i++) {
     if (checkboxes[i].checked) {
        selected.push(checkboxes[i].value); 
     }
  }
        voltran = selected.join("|"); 
        document.getElementById("col11_filter").value = voltran;
        filterColumn( $('input.column_filter').parents('tr').attr('data-column') );
        
  });
});

Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Replies

  • allanallan Posts: 63,471Questions: 1Answers: 10,467 Site admin

    In what way are mobile browser's not working? Is DataTables not initialising, or your click event on the checkbox not detected, or something else? We'd need a link to a test case showing the issue, per the forum rules please.

    Allan

This discussion has been closed.