Using the datagrid enableFilter I would like to add a text to the label, or actually a button. My code is now
function dg_filter_bar(dg) {
if (!dg.length) { dg = get_dg_index(dg)[0] }
var dg_options = dg.datagrid('options');
if (dg.datagrid('isFilterEnabled')) {
dg.datagrid('removeFilterRule').datagrid('disableFilter').datagrid('reload');
return;
}
var cols = JSON.parse(JSON.stringify(dg_options.columns[0]));
cols.splice(0, 1);
cols.splice(cols.length - 1, 1);
///*
var zFilterRow = [];
$.each(cols, function (i, o) {
var options;
if (o.title === "" || o.field === "") { return true; }
options = dg_fld_options(dg, dg_options, o);
zFilterRow.push({
field: o.field
, type: 'combogrid'
, options: options
});
});
zFilterRow.push({ field: 'edt', type: 'label' });
zFilterRow.push({ field: 'men', type: 'label', text:'myLabelText' });
zFilterRow.push({ field: 'del', type: 'label' });
dg.datagrid('enableFilter', zFilterRow);
// */
}
giving result as in attached pic. However my text "myLabelText" wont show-up.
Thanks for advice!