In that case you need to extend the filter object to include both parameters.
Let's have this filter form (HTML):
<div class="space">
Filter: <input id="filter" /> <a href="#" id="clear">Clear</a>
<input type="checkbox" id="hideEmpty"> Hide empty
</div>
Filter rule (onRowFilter):
dp.onRowFilter = function(args) {
var query = args.filter.query;
var hideEmpty = args.filter.hideEmpty;
if (args.row.name.toUpperCase().indexOf(query.toUpperCase()) === -1) {
args.visible = false;
}
else if (hideEmpty && args.row.events.isEmpty()){
args.visible = false;
}
};
And you need to include both parameters (here it is the search string as "query" and the checkbox state as "hideEmpty") in the rows.filter() argument:
$(document).ready(function() {
function filter() {
dp.rows.filter({
query: $("#filter").val(),
hideEmpty: $("#hideEmpty").is(":checked")
});
}
$("#filter").keyup(function() {
filter();
});
$("#hideEmpty").change(function() {
filter();
});
$("#clear").click(function() {
$("#filter").val("");
dp.rows.filter(null);
return false;
});
});