Hi,
I added textbox in tbar, I want to make that textbox as filter. If I enter text in the textbox it should apply filter on name column. Please help me how to achieve it. Thanks in advance
Thanks,
Bharat
Hi,
Then you could use the input listener
tbar : [{
type : 'textfield',
width : 300,
label : 'filter name colum',
listeners : {
input(props) {
const { source, value } = props;
const { store } = source.up('grid');
store.clearFilters();
store.filter(record => record.name.includes(value));
}
},
}],
https://bryntum.com/products/grid/docs/api/Core/widget/TextField#event-input
Hi,
Hopefully, this would be helpful for you
listeners : {
input(props) {
const { source, value } = props;
const { store } = source.parent.parent;
store.clearFilters();
if (value.trim() === '') {
store.clearFilters();
}
else {
store.filter(record => {
if (Boolean(record.name.toLowerCase().includes(value.toLowerCase()))) {
if (record.isLeaf) {
return record.parent;
}
return record;
}
});
}
}
}
https://bryntum.com/products/grid/docs/api/Core/data/Model
https://bryntum.com/products/grid/docs/api/Core/data/Store
Hi,
It seems to be working fine here with the above code I suggested
I tried here https://bryntum.com/products/grid/examples/tree/