我有一个extjs(ExtJS 3)网格面板,它使用JsonStore从postgresql数据库加载。这是我的Json商店:
var dropPickGridStore = new Ext.data.JsonStore({
fields : [ {
name : 'locationName'
}, {
name : 'city'
}, {
name : 'addr'
}, {
name : 'estimatedTime'
} ],
root : 'dropPickLoc',
idProperty : 'locationName',
//autoDestroy : true,
autoLoad : true,
proxy : new Ext.data.HttpProxy({
url : "http://" + host + ":" + port + "/" + projectName + "/"
+ "PendingDropPicks"
}),
reader : {
type : 'json',
root : 'dropPickLoc'
},
});
这是我的网格面板:
var selectModel = new Ext.grid.CheckboxSelectionModel();
/*selectModel : Ext.create('Ext.selection.CheckboxModel', {
checkOnly: true,
mode: 'MULTI'
});*/
var drop_pick_grid = new Ext.grid.GridPanel({
store : dropPickGridStore,
cm : new Ext.grid.ColumnModel([ selectModel, {
sortable : true,
header : "Drop/Pick Loc",
dataIndex : 'locationName',
width : 170
}, {
header : "Town/City",
sortable : true,
dataIndex : 'city',
width : 120
}, {
header : "Address",
sortable : true,
dataIndex : 'addr',
width : 170
}, {
header : "EST.Un/Load Time",
sortable : true,
dataIndex : 'estimatedTime',
width : 100
} ]),
sm : selectModel,
//width : 570,
//height : 390,
autoHeight : true,
autoWidth : true,
frame : true,
iconCls : 'icon-grid'
});
gris已成功加载。但有一个问题。我只能检查标题行复选框。我不能选择任何一行。它应该具有选择单个行的能力,它还应该通过单击标题复选框来选择所有行。我的代码出了什么问题?
任何人都可以非常友好地解释我的代码出了什么问题,我该如何解决?
谢谢