Title: datagrid filter textboxes - set prompt Post by: gordis gmbh on June 20, 2016, 07:57:05 AM How can I set a default prompt to all the filter textboxes of all filter-enabled datagrids?
The prompt may be for e.g. 'enter filter text here...' Title: Re: datagrid filter textboxes - set prompt Post by: stworthy on June 20, 2016, 06:13:49 PM Just set the 'prompt' option for the textbox.
Code: dg.datagrid('enableFilter', [{ Title: Re: datagrid filter textboxes - set prompt Post by: gordis gmbh on June 23, 2016, 02:33:01 AM To enable filter as per your suggesstion one needs field name.
We enable filter for all datagrids in one central location as follows: Code: if (specialFilters.length > 0) { As you can see, there is no datagrid-field information given for textbox-based filters. Special filters are combobox or datebox or numberbox filters which contain field-name and corresponding options... For time being I found a workaround by adding the following line directly in source code file "datagrid-filter.js": Code: input.attr('placeHolder', 'enter filter text here ...'); This works but I am looking for a possibility to do the same - by default - for all filter-enabled datagrids without modifying the source code. Perhaps by extending the filter - plugin in my code. But the problem is, setting the prompt after the textbox is initialised effects the textbox size! Any ideas in this direction are welcome ... Title: Re: datagrid filter textboxes - set prompt Post by: stworthy on June 23, 2016, 07:58:56 AM You can override the 'defaultFilterType' and 'defaultFilterOptions' to set properties for all un-specialed fields.
Code: var dg = $('#dg').datagrid({ |