-
9 Jul 2012 5:38 PM #1
The issue of enableLocking in a grid.
The issue of enableLocking in a grid.
Ext version tested:
Ext 4.1.1(GA)
Browser versions tested against:
Chromium 18.0.1025.168 (Ubuntu 12.04)
Description:
Add 'enableLocking' and 'grouping' to a grid, there will be two groupheads;
Duplicate the grouphead, as shown follows:Code:Ext.define('App.view.userGrid', { extend: 'Ext.grid.Panel', alias: 'widget.usergrid', store: 'Users', features: [{ftype:'grouping', groupHeaderTpl: 'Type: {name} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})', startCollapsed: true //this item is invalid. }], enableLocking: true, initComponent: function () { Ext.apply(this, { columns: [ { xtype: 'rownumberer',text: 'SN', width: 26 ,locked :true }, { text: columnsTextArr[12], dataIndex: 'rname' }, { text: columnsTextArr[1], dataIndex: 'call' }, { text: columnsTextArr[2], dataIndex: 'email' }, { text: columnsTextArr[3], dataIndex: 'usertype', renderer: getUserType }], }); this.callParent(arguments); } });
2012-07-06-1.png
Add the'enableLocking' and 'checkboxmodel' to a grid, there will be two columns of checkbox;
Duplicate the checkboxes, as shown follows:Code:Ext.define('App.view.userGrid', { extend: 'Ext.grid.Panel', alias: 'widget.usergrid', store: 'Users', selModel: { selType: 'checkboxmodel', mode: 'MULTI', checkOnly: true }, features: [{ftype:'grouping', groupHeaderTpl: 'Type: {name} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})' }], enableLocking: true, initComponent: function () { Ext.apply(this, { columns: [ { xtype: 'rownumberer',text: 'SN', width: 26 ,locked :true }, { text: columnsTextArr[12], dataIndex: 'rname' }, { text: columnsTextArr[1], dataIndex: 'call' }, { text: columnsTextArr[2], dataIndex: 'email' }, { text: columnsTextArr[3], dataIndex: 'usertype', renderer: getUserType }], }); this.callParent(arguments); } });
2012-07-06-2.png
-
9 Jul 2012 6:30 PM #2
I tried the first with the latest codebase and it seems to work ok (see startCollapsed):
Code:Ext.define('App.view.userGrid', { extend: 'Ext.grid.Panel', alias: 'widget.usergrid', store: 'Users', features: [{ ftype: 'grouping', groupHeaderTpl: 'Type: {name} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})', startCollapsed: true }], enableLocking: true, initComponent: function() { Ext.apply(this, { columns: [{ xtype: 'rownumberer', text: 'SN', width: 100, locked: true }, { text: 'Foo', dataIndex: 'foo' }, { text: 'Bar', dataIndex: 'bar' }, { text: 'Baz', dataIndex: 'baz' }] }); this.callParent(arguments); } }); Ext.onReady(function() { new App.view.userGrid({ renderTo: document.body, width: 400, height: 400, store: { groupField: 'foo', fields: ['foo', 'bar', 'baz'], data: [{ foo: 'foo1', bar: 'bar1', baz: 'baz1' }, { foo: 'foo2', bar: 'bar2', baz: 'baz2' }] } }); });Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
9 Jul 2012 6:31 PM #3
The second issue already has a fix pending to be merged in.
As such, going to mark this as closed, since both issues are taken care of. Thanks for the test cases.Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
Looks like we can't reproduce the issue or there's a problem in the test case provided.


Reply With Quote