ExtJS 3已锁定:真的不起作用

时间:2018-05-15 22:00:06

标签: extjs extjs3

我正在尝试在滚动时锁定第一列。 locked: trueenableautoLocking: 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);

1 个答案:

答案 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);