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
Extjs网格始终选择第一行,即使我选择了任何其他行_Extjs_Row_Selection_Gridpanel - Fatal编程技术网

Extjs网格始终选择第一行,即使我选择了任何其他行

Extjs网格始终选择第一行,即使我选择了任何其他行,extjs,row,selection,gridpanel,Extjs,Row,Selection,Gridpanel,我正在尝试创建一个带有编辑功能的extjs网格。我能够用我的存储数据填充网格。但当我选择一行(比如第5行)时,第1行被选中 Ext.define('Ext.User', { extend: 'Ext.grid.Panel', alias: 'widget.user', title: 'User', //Set the store iconCls: 'config', //stateful: false, store: 'User', selModel: new Ext.selection

我正在尝试创建一个带有编辑功能的extjs网格。我能够用我的存储数据填充网格。但当我选择一行(比如第5行)时,第1行被选中

Ext.define('Ext.User', {
extend: 'Ext.grid.Panel',
alias: 'widget.user',

title: 'User',
//Set the store
iconCls: 'config',

//stateful: false,

store: 'User',

selModel: new Ext.selection.RowModel({singleSelect:true}),


initComponent: function() {

    this.columns = [
              { 
                text: 'User', 
                width: '5%', 
                dataIndex: 'userName',  
              },
              { 
                text: 'Password', 
                width: '5%',
                dataIndex: 'password',  
              },
              { 
                text: 'Role', 
                width: '5%', 
                dataIndex: 'roleName',
              },
              { 
                text: 'Last Login', 
                width: '5%',
                dataIndex: 'lastLogin',  
              }

          ],
    this.width = '100%',
    this.height = '100%',           

    this.callParent();
  }
});

任何可能发生这种情况的建议。提前感谢

如果我理解正确,您希望通过选择直接行来管理存储数据

然后解决方案是让你的网格能够正确地聆听你的点击

{
        xtype: 'grid',
        title: 'gridTitle',
        store: Ext.StoreManager.lookup('storeId'),
        listeners: {
            cellclick: function (grid, td, cellIndex, record, tr, rowIndex, e) {


            }
        },
因此,在上面的代码中,您应该能够使用她的数据处理某些行


希望它能有所帮助

嗨,阿列克西,我想做的是用删除按钮显示一个网格,当用户选择一行时,我们需要将其从网格中删除。当前,无论我选择哪一行,都会选择第一行