2013-03-27 23 views
0

Ext.grid.Panel中的插件属性的语法是什么?如果我在下面的代码注释掉的插件属性,它工作正常,但如果留在它产生一个错误。在Extjs 4.1中分配插件属性的语法是什么

this.grid = new Ext.grid.Panel({ 
    id: "t-"+this.gridName+"-grid", 
    header: true, 
    title: gridTitle, 
    selType : 'rowmodel', 
    border: false, 
    store: store,    
    columns: cm, 
    selModel: sm, 
    loadMask: true, 
    provider: this.page.provider, 
    viewConfig: { 
     stripeRows: true 
    }, 
    plugins: [Ext.create('Ext.ux.grid.GridHeaderFilters')] 
}); 
+0

这看起来很好。它升起了什么错误?你的列配置和商店是什么样的? – zeke 2013-03-27 15:10:47

+0

你的代码似乎没问题。 'Ext.ux.grid.GridHeaderFilters'有不少bug。请参阅[本主题](http://www.sencha.com/forum/showthread.php?150918-Grid-Header-Filters)了解如何解决这些问题。 – Izhaki 2013-03-28 00:02:15

回答

0

上面的语法是完全正确的。确保使用Ext.create创建的类必须与define具有相同的名称。

"Ext.define('Ext.ux.grid.RowExpander',{" 

还检查init函数。无论您在grid.on中指定的方法,即“this.onRender”,都必须存在于您的插件文件中。有时候为了测试的目的,我们删除了那个,但没有意识到这一点

init : function(grid){ 
     grid.on('render',  this.onRender,  this); 

    }, 
相关问题