-
20 Mar 2012 4:59 AM #1
ExtJS 4 Grid Filtering issue: no searching icon in StringFilter
ExtJS 4 Grid Filtering issue: no searching icon in StringFilter
You can see this issue in this example: http://docs.sencha.com/ext-js/4-0/#!/example/grid-filtering/grid-filter-local.html
Try to filter "Company" column, and you will not see any icon near text field.
I got some source code from RangeMenu (my idea was the principle of working NumberFilter) to fix this issue (please replace all "Ext4" to "Ext"):
PHP Code:init : function (config) {
Ext4.applyIf(config, {
enableKeyEvents : true,
hideLabel : false,
fieldLabel : this.getIconTpl().apply({
cls : this.iconCls || 'no-icon',
text : this.emptyText || '',
src : Ext4.BLANK_IMAGE_URL
}),
labelSeparator : '',
labelWidth : 29,
listeners : {
scope : this,
keyup : this.onInputKeyUp,
el : {
click : function (e) {
e.stopPropagation();
}
}
}
});
this.inputItem = Ext4.create('Ext4.form.field.Text', config);
this.menu.add(this.inputItem);
this.updateTask = Ext4.create('Ext4.util.DelayedTask', this.fireUpdate, this);
},
/**
* Возвращает шаблон иконки
* @return {Ext4.XTemplate}
*/
getIconTpl : function () {
return Ext4.create('Ext4.XTemplate',
'<img src="{src}" alt="{text}" class="' + Ext4.baseCSSPrefix + 'menu-item-icon ux-rangemenu-icon {cls}" />'
);
},
-
20 Mar 2012 8:02 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,582
- Vote Rating
- 433
The reason you are not seeing an icon is because it's only a text field in that menu which doesn't accept an iconCls.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
20 Mar 2012 8:27 AM #3
Main reason is you do not want to admit one's fault. There is find.png icon, there is CSS, there is code in StringFilter to use style from CSS!
-
20 Mar 2012 8:36 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,582
- Vote Rating
- 433
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
20 Mar 2012 10:26 PM #5
See your own example, see your own source code.
-
21 Mar 2012 4:25 AM #6Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,582
- Vote Rating
- 433
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
21 Mar 2012 4:48 AM #7
Okay, and what is the reason to have:
1) find.png icon in images
2) CSS rule which uses this icon
3) Source code which uses this css rule as iconCls
?!!
-
20 Sep 2012 2:19 PM #8
Example code has iconCls defined which is not displayed
Example code has iconCls defined which is not displayed
In Ext4 Examples code, Local Grid filter has iconCls defined in StringFilter.
But, textField config doesnt have such config, so it is not displayed at all.
Need to provide an alternative to display this icon. If not the separation line behind the textfield is not looking good. You can see this in the examples provided with latest version too.
guyfawkes,
Even your code doesnt display that. I tried it with Ext 4.1.1.
Thanks,
Sriram
-
20 Sep 2012 2:43 PM #9
Find icon displayed after some trials.. :)
Find icon displayed after some trials.. :)
It worked using below code in StringFilter.js:
Ext.applyIf(config, {
enableKeyEvents: true,
labelCls: 'ux-rangemenu-icon '+this.iconCls,
hideEmptyLabel: false,
labelSeparator: '',
labelWidth: 29,
...
});
Thanks,
Sriram


Reply With Quote