EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: officecode on January 15, 2019, 09:48:04 PM



Title: How to set defaultFilterOptions in datagrid-filter?
Post by: officecode on January 15, 2019, 09:48:04 PM
Since the defaultFilterType defaults to text, why is the following code invalid and error?

Code:

$('#dg').datagrid({
url:...,
        columns:...,
pagination:true,
defaultFilterOptions:{
placeholder:'enter filter text here...'
}
}).datagrid('enableFilter')



Title: Re: How to set defaultFilterOptions in datagrid-filter?
Post by: jarry on January 16, 2019, 06:00:33 AM
Please try this code.
Code:
var dg = $('#dg').datagrid({
    defaultFilterType: 'textbox',
    defaultFilterOptions: $.extend({}, $.fn.datagrid.defaults.defaultFilterOptions, {
        prompt: 'enter filter text here...'
    })
});


Title: Re: How to set defaultFilterOptions in datagrid-filter?
Post by: gordis gmbh on January 30, 2020, 03:35:18 AM
Sorry to take up an old issue, but
defaultFilterOptions to set a filter promt, as suggested by Jarry in the previous post, doesn't seem to work:

http://code.reloado.com/isuzex3/6/edit#preview (http://code.reloado.com/isuzex3/6/edit#preview)

Would be great if someone at EasyUI support could check this one out.


Title: Re: How to set defaultFilterOptions in datagrid-filter?
Post by: jarry on January 30, 2020, 04:13:40 AM
This example works fine.
http://code.reloado.com/isuzex3/7/edit#preview