我正在尝试在滚动时锁定第一列。 locked: true
和enableautoLocking: true
无效。
代码段:
var fieldColumn = {
header: 'Field Name',
css: 'background-color:#eee;cursor:auto;',
sortable: false,
dataIndex: 'fieldName',
locked: true,
autoSizeColumn: true,
width: 140
};
this.columns.push(fieldColumn);
Ext.apply(this, {
cls: 'fieldgrid',
layout: 'table',
store: this.fieldStore,
autoScroll: true,
loadMask: CNQR.admin.loadMask,
plugins: headerCategoryGroup,
colModel: new Ext.grid.ColumnModel({
defaults: {
sortable: false
},
columns: this.columns
}),
selModel: selectModel,
tbar: new Ext.Toolbar({
ctCls: 'grayButtonToolBar border-toolbar',
buttons: [
this.saveButton, this.cancelButton
]
}),
bbar: new Ext.PagingToolbar({
store: this.fieldStore,
pageSize: this.pageSize,
displayInfo: true,
beforePageText: CNQR.getMsg('bbarBeforePageText'),
afterPageText: CNQR.getMsg('bbarAfterPageText'),
displayMsg: CNQR.getMsg('bbarDisplayMsg'),
emptyMsg: CNQR.getMsg('bbarNoRecordsFound')
})
});
CNQR.admin.superclass.initComponent.apply(this, arguments);
答案 0 :(得分:0)
更详细的答案在这里试试这个
var fieldColumn = {
header: 'Field Name',
css: 'background-color:#eee;cursor:auto;',
sortable: false,
dataIndex: 'fieldName',
locked: true,
autoSizeColumn: true,
width: 140
};
this.columns.push(fieldColumn);
Ext.apply(this, {
cls: 'fieldgrid',
layout: 'table',
store: this.fieldStore,
autoScroll: true,
loadMask: CNQR.admin.loadMask,
plugins: headerCategoryGroup,
view: new Ext.ux.grid.LockingGridView(),
colModel: new Ext.ux.grid.LockingColumnModel({
defaults: {
sortable: false
},
columns: this.columns
}),
selModel: selectModel,
tbar: new Ext.Toolbar({
ctCls: 'grayButtonToolBar border-toolbar',
buttons: [
this.saveButton, this.cancelButton
]
}),
bbar: new Ext.PagingToolbar({
store: this.fieldStore,
pageSize: this.pageSize,
displayInfo: true,
beforePageText: CNQR.getMsg('bbarBeforePageText'),
afterPageText: CNQR.getMsg('bbarAfterPageText'),
displayMsg: CNQR.getMsg('bbarDisplayMsg'),
emptyMsg: CNQR.getMsg('bbarNoRecordsFound')
})
});
CNQR.admin.superclass.initComponent.apply(this, arguments);