EasyUI Forum

General Category => General Discussion => Topic started by: xpyro on March 17, 2017, 01:09:36 AM



Title: Chain Combobox on Datagrid Filter Row
Post by: xpyro on March 17, 2017, 01:09:36 AM
how can i make a chain combobox on Datagrid Filter Row ? for common sample in datagrid : city | country.
city load database. but after selection on city, combobox on country will displaying only related item from city.
i've read combo-tree sample, but still dont know how to implement it to datagrid filter row with separate column.

Note : I use remote filter row.


Title: Re: Chain Combobox on Datagrid Filter Row
Post by: stworthy on March 17, 2017, 06:09:23 PM
You can call 'getFilterComponent' method to get the special filter combobox component and reload its data. Please refer to the code below:
Code:
dg.datagrid('enableFilter', [{
    field:'field1',
    type:'combobox',
    options:{
        onChange: function(value){
            var cb2 = dg.datagrid('getFilterComponent', 'field2');
            //...
        }
    }
},{
    field:'field2',
    type:'combobox',
    options:{
        //...
    }
}]);