Page 2 of 2

Re: [ANGULAR] : Need help with combo type filter on grid

Posted: Fri Aug 09, 2024 1:33 pm
by joakim.l

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';
        }
    }
}

Re: [ANGULAR] : Need help with combo type filter on grid

Posted: Fri Aug 09, 2024 3:47 pm
by satya

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';}}"

Re: [ANGULAR] : Need help with combo type filter on grid

Posted: Fri Aug 09, 2024 11:27 pm
by marcio

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


Re: [ANGULAR] : Need help with combo type filter on grid

Posted: Sat Aug 10, 2024 1:34 pm
by Animal

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


Re: [ANGULAR] : Need help with combo type filter on grid

Posted: Wed Aug 28, 2024 1:46 pm
by satya

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;}
            }
        },

Re: [ANGULAR] : Need help with combo type filter on grid

Posted: Thu Aug 29, 2024 9:47 am
by alex.l

Hi,

Yes please, try to upgrade your application and let us know.

Thank you!