Results 1 to 3 of 3

Thread: The issue of enableLocking in a grid.

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Apr 2010
    Location
    China
    Posts
    43
    Vote Rating
    0
      0  

    Default 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;

    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);
    
    
        }
    });
    Duplicate the grouphead, as shown follows:
    2012-07-06-1.png

    Add the'enableLocking' and 'checkboxmodel' to a grid, there will be two columns of checkbox;
    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);
    
    
        }
    });
    Duplicate the checkboxes, as shown follows:
    2012-07-06-2.png

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,583
    Vote Rating
    873
      0  

    Default

    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'
                }]
            }
        });
    
    });
    Attached Images Attached Images
    Evan Trimboli
    Twitter - @evantrimboli

  3. #3
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,583
    Vote Rating
    873
      0  

    Default

    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
    Twitter - @evantrimboli

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •