ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: shldbapp on April 13, 2015, 08:06:12 pm
-
I am working with a local copy of
http://paramquery.com/pro/demos/filter_header_local
Where I added the following code for a toolbar with a checkbox:
toolbar: {
cls: "pq-toolbar-search",
items: [
{ type: "<span style='margin:2px;'>Grid Title</span>" },
{ type: 'separator' },
{
type: 'checkbox', style: 'margin-right:5px;', attr: 'id=seinactive', listener:
{
"change": function (evt, ui) {
// Function
filter("Ship Country", "Brazil");
}
}
},
{ type: "<label for='seinactive'>Inactive</label>" },
And the function to filter:
function filter(dataIndx, value) {
$grid = $("#grid_custom_editing").closest('.pq-grid');
$grid.pqGrid("filter", {
data: [{ dataIndx: dataIndx, value: value, type: "local" }]
});
$grid.pqGrid("refreshDataAndView");
}
Unfortunately it does not work. The filter has no effect on the grid. How to make it work?
-
Check whether you have defined filterModel correctly.
filterModel: { on: true, header: true, type: 'local' },
Check whether your filter function is getting called by putting a breakpoint or alert box.
You syntax for filter method is incorrect, arguments are missing.
Please refer the API http://paramquery.com/pro/api#method-filter
Please post a jsfiddle if still facing problems.