104 lines
3.7 KiB
JavaScript
104 lines
3.7 KiB
JavaScript
var Script = function () {
|
|
|
|
// begin first table
|
|
$('#sample_1').dataTable({
|
|
"sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
|
|
"sPaginationType": "bootstrap",
|
|
"oLanguage": {
|
|
"sLengthMenu": "_MENU_ records per page",
|
|
"oPaginate": {
|
|
"sPrevious": "Prev",
|
|
"sNext": "Next"
|
|
}
|
|
},
|
|
"aoColumnDefs": [{
|
|
'bSortable': false,
|
|
'aTargets': [0]
|
|
}]
|
|
});
|
|
|
|
jQuery('#sample_1 .group-checkable').change(function () {
|
|
var set = jQuery(this).attr("data-set");
|
|
var checked = jQuery(this).is(":checked");
|
|
jQuery(set).each(function () {
|
|
if (checked) {
|
|
$(this).attr("checked", true);
|
|
} else {
|
|
$(this).attr("checked", false);
|
|
}
|
|
});
|
|
jQuery.uniform.update(set);
|
|
});
|
|
|
|
jQuery('#sample_1_wrapper .dataTables_filter input').addClass("input-medium"); // modify table search input
|
|
jQuery('#sample_1_wrapper .dataTables_length select').addClass("input-mini"); // modify table per page dropdown
|
|
|
|
// begin second table
|
|
$('#sample_2').dataTable({
|
|
"sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
|
|
"sPaginationType": "bootstrap",
|
|
"oLanguage": {
|
|
"sLengthMenu": "_MENU_ per page",
|
|
"oPaginate": {
|
|
"sPrevious": "Prev",
|
|
"sNext": "Next"
|
|
}
|
|
},
|
|
"aoColumnDefs": [{
|
|
'bSortable': false,
|
|
'aTargets': [0]
|
|
}]
|
|
});
|
|
|
|
jQuery('#sample_2 .group-checkable').change(function () {
|
|
var set = jQuery(this).attr("data-set");
|
|
var checked = jQuery(this).is(":checked");
|
|
jQuery(set).each(function () {
|
|
if (checked) {
|
|
$(this).attr("checked", true);
|
|
} else {
|
|
$(this).attr("checked", false);
|
|
}
|
|
});
|
|
jQuery.uniform.update(set);
|
|
});
|
|
|
|
jQuery('#sample_2_wrapper .dataTables_filter input').addClass("input-small"); // modify table search input
|
|
jQuery('#sample_2_wrapper .dataTables_length select').addClass("input-mini"); // modify table per page dropdown
|
|
|
|
// begin: third table
|
|
$('#sample_3').dataTable({
|
|
"sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
|
|
"sPaginationType": "bootstrap",
|
|
"oLanguage": {
|
|
"sLengthMenu": "_MENU_ per page",
|
|
"oPaginate": {
|
|
"sPrevious": "Prev",
|
|
"sNext": "Next"
|
|
}
|
|
},
|
|
"aoColumnDefs": [{
|
|
'bSortable': false,
|
|
'aTargets': [0]
|
|
}]
|
|
});
|
|
|
|
jQuery('#sample_3 .group-checkable').change(function () {
|
|
var set = jQuery(this).attr("data-set");
|
|
var checked = jQuery(this).is(":checked");
|
|
jQuery(set).each(function () {
|
|
if (checked) {
|
|
$(this).attr("checked", true);
|
|
} else {
|
|
$(this).attr("checked", false);
|
|
}
|
|
});
|
|
jQuery.uniform.update(set);
|
|
});
|
|
|
|
jQuery('#sample_3_wrapper .dataTables_filter input').addClass("input-small"); // modify table search input
|
|
jQuery('#sample_3_wrapper .dataTables_length select').addClass("input-mini"); // modify table per page dropdown
|
|
|
|
|
|
|
|
}(); |