Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Extjs 未在RowModel的select事件上定义Ext_Extjs_Extjs4.1_Extjs Mvc - Fatal编程技术网

Extjs 未在RowModel的select事件上定义Ext

Extjs 未在RowModel的select事件上定义Ext,extjs,extjs4.1,extjs-mvc,Extjs,Extjs4.1,Extjs Mvc,我有一个绑定到网格的表单,用户可以在其中创建新用户或选择网格中的一行并编辑用户。在网格中选择一行应该会改变某些按钮的可见性。无论如何,我的主要障碍是Ext似乎没有在rowselect事件上完全加载。我在firebug中遇到的错误是: 类型错误:Ext.getCmp。。。是未定义的 以下是我的MVC控制器中的一段代码: .... init: function() { this.control({ 'userlist': { selectionchan

我有一个绑定到网格的表单,用户可以在其中创建新用户或选择网格中的一行并编辑用户。在网格中选择一行应该会改变某些按钮的可见性。无论如何,我的主要障碍是Ext似乎没有在rowselect事件上完全加载。我在firebug中遇到的错误是:

类型错误:Ext.getCmp。。。是未定义的

以下是我的MVC控制器中的一段代码:

....
init: function() {
    this.control({
        'userlist': {
            selectionchange: this.gridSelectionChange,
            viewready: this.onViewReady,
            select: this.onRowSelect
        },
        'useredit button[action=update]': {
            click: this.updateUser
        },

        'useredit button[action=create]': {
            click: this.createUser
        }
    });
},

onRowSelect: function(model, record, index, opts) {
    // Switch to the Edit/Save button
    //console.log(model);
    Ext.getCmp('pplmgr-user-create').hide();
    Ext.getCmp('pplmgr-user-create').show();
    Ext.getCmp('id=pplmgr-user-reset').show();
},
....

是否有其他方法/事件来实现这一点?我在selectionchange和select事件中都尝试过,也尝试过使用Ext.Component.Query,但这些事件中似乎还没有使用Ext。我非常感谢任何帮助,包括通知我一个更好的实践来完成同样的事情。

如果您有您的观点,您可以尝试以下方法:

myView.down('pplmgr-user-create').hide();
....
....
getCmp将id作为其参数。您对它的第三次调用的id=…,id=部分混淆了getCmp,因此它返回未定义

如果您将最后一次通话更改为仅使用id,则您应该可以:

Ext.getCmp('pplmgr-user-reset').show();

非常感谢你。在Zend Framework 2和ExtJS MVC上花了两天12个小时来提高速度,这让他们付出了代价!