Using "DataGrid Filter Row" extension, I want to toggle the Filter Row on and off. How can I do that?
My code turning the filter row on and off works and it looks like this:
function dg_clickHeaderMenu(target) {
menu.menu('appendItem', { text: 'Filter', handler: function () { dg.datagrid('enableFilter'); } });
menu.menu('appendItem', { text: 'No filter', handler: function () { dg.datagrid('disableFilter'); } });
menu.menu('show', {left: 25 + $(target).offset().left, top: -(0) - 10 + $(target).offset().top, align: 'right' });
}
However I want to make it conditionally so either "Filter" or "No filter" is shown dependant on if the filter is there.
So what I would like to have is something similar to:
function dg_clickHeaderMenu(target) {
var filter = ???
if (filter) {
menu.menu('appendItem', { text: 'No filter', handler: function () { dg.datagrid('disableFilter'); } });
} else {
menu.menu('appendItem', { text: 'Filter', handler: function () { dg.datagrid('enableFilter'); } });
}
}
menu.menu('show', {left: 25 + $(target).offset().left, top: -(0) - 10 + $(target).offset().top, align: 'right' });
}
where my question is - how do I get the "DataGrid Filter Row" true / false property out-of the datagrid plugin?