在ExtJS网格中禁用多行选择
在我的问题中已经有一个类似的问题: 但公认的答案是错误的。它表示使用RowSelectionModel作为如下属性:在ExtJS网格中禁用多行选择,extjs,extjs4.2,Extjs,Extjs4.2,在我的问题中已经有一个类似的问题: 但公认的答案是错误的。它表示使用RowSelectionModel作为如下属性: selModel: new Ext.grid.RowSelectionModel({singleSelect:true}), 但是在API中不存在这样的东西(也许他们在谈论一个不同的extjs版本) 如何在Extjs网格中禁用多重选择?即,无需SHIFT或CTRL多选。仅允许单个选择。请参阅 这表明您可以像这样指定选择模型: 默认情况下,轴网使用行选择模型,但这很容易自定义,
selModel: new Ext.grid.RowSelectionModel({singleSelect:true}),
但是在API中不存在这样的东西(也许他们在谈论一个不同的extjs版本)
如何在Extjs网格中禁用多重选择?即,无需SHIFT或CTRL多选。仅允许单个选择。请参阅
这表明您可以像这样指定选择模型:
默认情况下,轴网使用行选择模型,但这很容易自定义,如下所示:
或者另一种选择是:
Ext.create('Ext.grid.Panel', {
selType: 'rowmodel',
store: ...
});
编辑:
您需要指定
这并不能回答我的问题。我正在尝试使用SHIFT或CTRL禁用多行选择
Ext.create('Ext.grid.Panel', {
selType: 'rowmodel',
store: ...
});
Ext.application({
name: 'MyApp',
launch: function() {
var store = Ext.create('Ext.data.Store', {
storeId: 'simpsonsStore',
fields: ['name', 'email', 'phone'],
proxy: {
type: 'ajax',
url: 'data1.json',
reader: {
type: 'json',
rootProperty: 'items'
}
},
autoLoad: true
});
Ext.create("Ext.grid.Panel", {
title: 'Simpsons',
renderTo: Ext.getBody(),
store: Ext.data.StoreManager.lookup('simpsonsStore'),
selModel: new Ext.selection.RowModel({
mode: "SINGLE"
}),
columns: [{
text: 'Name',
dataIndex: 'name'
}, {
text: 'Email',
dataIndex: 'email',
flex: 1
}, {
text: 'Phone',
dataIndex: 'phone'
}],
height: 200,
width: 400,
});
}
});