Premium support for our pure JavaScript UI components
If your combo has multiSelect
, then value
will be an array of values. Example code would look like this then:
{
filterable : {
filterField : {
type : "combo",
multiSelect : true,
editable : true,
items : ["Pending - Credit", "Completed", "Canceled", "Restricted", "N/A"],
filterFn : function({ value, record }){
for (const val of value) {
if(record.StatusDescription === ((val === 'N/A') ? null : val){
return true;
}
}
return false;
}
}
},
renderer : ({ value, record, field }) => {
if (value && value != null) {
return '<div style="text-overflow:ellipsis; white-space:nowrap;">' + value +'</div>';
}
else {
return 'N/A';
}
}
}
Didnt do the trick either. Is it possible to do it in a call please or i can grant temporary access to our sandbox
{
"filterable": {
"filterField" : {
"type" : "combo",
"multiSelect" : true,
"editable" : true,
"items" : ["Pending - Credit", "Completed", "Canceled", "Restricted", "N/A"],
"filterFn": "function({value, record}){for (const val of value) {if(record.StatusDescription === ((val === 'N/A') ? null : val){return true;}}return false;}"
}
},
"renderer" :"({ value, record, field }) => {if(value && value != null){return '<div style=\"text-overflow:ellipsis; white-space:nowrap; \">' + value+'</div>'; } else {return 'N/A';}}"
Hey satya,
Unfortunately, calls are outside of the scope of this forum. For that, you'll need to contact our professional services here https://bryntum.com/services/ .
You can generate an user to your sandbox and send the info to support[at]bryntum.com
Before you go down that route, just set a debugger breakpoint in that filterFn
.
And when it stops there, just go in and work out the expression that you need. Given the record
being passed in, the value
of the field.
You just need to return true
for yes, include this record and false
for hide it.
There's nothing more to it than that. You just decide true
/false
We are using bryntum version: bryntum_grid_5_6_6 . What i see when i inserted breakpoint is , this function is not even getting called on dropdown filter. Could it be an issue with bryntum version we are using? i put the same function in bryntum example page, it seem to go inside function
Do we need to upgrade our grid?
https://bryntum.com/products/grid/examples/filterbar/
{
text : 'City',
field : 'city',
flex : 1,
editor : cityCombo,
minWidth : 190,
filterable : {
filterField : Object.assign(cityCombo, { multiSelect : true }),
filterFn: ({value, record}) => { console.log('Inside FilterFunction'); for (const val of value) {if(record.cityCombo == ((val == 'Montreal') ? null : val)){return true;}}return false;}
}
},
Hi,
Yes please, try to upgrade your application and let us know.
Thank you!