Results 1 to 3 of 3

Thread: gridpanel collapse expand issue

  1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    192
    Answers
    5

    Default gridpanel collapse expand issue

    Hi,
    I have a grid panel that when loaded is collapsed.
    Later I am adding rows of models to its store and trying to expand it.
    The problem is that after collapsing you cant see the grid.
    Only after closing and opening it manually it shown the grid.

    Any idea?

    I tried dolayou, I tried grid.getView().refresh() but nothing works

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410
    Answers
    716

    Default

    This seems to work as expected:

    Code:
    Ext.create('Ext.data.Store', {
        storeId : 'simpsonsStore',
        fields  : ['name', 'email', 'change'],
        data    : {'items' : [
            { 'name' : 'Lisa',  'email' : '[email protected]',  'change' : 100  },
            { 'name' : 'Bart',  'email' : '[email protected]',  'change' : -20  },
            { 'name' : 'Homer', 'email' : '[email protected]',  'change' : 23   },
            { 'name' : 'Marge', 'email' : '[email protected]', 'change' : -11  }
        ]},
        proxy   : {
            type   : 'memory',
            reader : {
                type : 'json',
                root : 'items'
            }
        }
    });
    
    var grid = Ext.create('Ext.grid.Panel', {
        title      : 'Simpsons',
        store      : Ext.data.StoreManager.lookup('simpsonsStore'),
        collapsible: true,
        collapsed  : true,
        columns    : [
            { header : 'Name', dataIndex : 'name' },
            { header : 'Email', dataIndex : 'email', flex : 1 },
            { header : 'Change', dataIndex : 'change' }
        ],
        height     : 200,
        width      : 400,
        renderTo   : Ext.getBody()
    });
    
    grid.expand();
    ?
    Scott.

  3. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    192
    Answers
    5

    Default Doesnt work for me

    In any case I added
    grid.setBodyStyle("visibility:visible");
    And that fixed the problem.
    I adont if it matter but my grid panel is inside an Ext.window

Posting Permissions

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