2013-03-27 40 views

回答

0

最好的方法是定义一个列组件。

Ext.define('Ext.ux.grid.MyColumn',{ 

extend: 'Ext.grid.column.Column', 

alias: 'widget.mycolumn', 

childEls: [ 
    'headerEl', 'titleEl', 'filterEl', 'triggerEl', 'headerTextEl', 'filterTextEl' 
], 

renderTpl: 
    'change it , and make your own TPL', 

initComponent: function() { 
// change or declare new data if you want. 
// me.callParent(arguments); 
// I have modified lot. so, I skip initComponent of Ext.grid.column.column 
me.superclass.superclass.initComponent.call(this); // directly call parents parent class. 
} 

}); 


USAGE : 
columns: [ 
    { 
     xtype: 'mycolumn', 
     itemId: 'sfsfsfsfsf', text: 'My filter column' 
    } 
] 
1

请参考以下链接。

http://www.sencha.com/forum/showthread.php?150918-Grid-Header-Filters

第二个选项菜单中过滤器,这是ExtJS的4.1实例可用。

http://docs.sencha.com/extjs/4.1.3/#!/example/grid-filtering/grid-filter-local.html

第三个选项是过滤行。

http://www.sencha.com/forum/showthread.php?128154-FilterRow-for-Ext-JS-4-Grids

其中的一个环节将引导您正确的道路。

问候。

+0

非常感谢您的回复,但我还是不知道答案。 – user2135671 2013-03-28 15:18:16

+0

请勿使用答案与海报进行交流。使用*评论* .. – Rob 2013-03-28 15:34:23

+0

好吧罗布。下次我会照顾。谢谢。 – 2013-04-03 10:41:24