DataTable Mobile Regex Filter with Checkbox
DataTable Mobile Regex Filter with Checkbox
blu3c4ndy
Posts: 1Questions: 0Answers: 0
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.
This discussion has been closed.
Replies
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