Hybrid View

  1. #1
    Sencha User
    Join Date
    Dec 2009
    Posts
    57
    Vote Rating
    0
    toole1 is on a distinguished road

      0  

    Default Answered: Locking Grid column menu

    Answered: Locking Grid column menu


    Is there a way to programmatically execute any of the items on the drop down menu for a column in a locking grid. I would like to lock and unlock or hide and unhide several columns based on a button in a tool bar on a locking grid. I am using ExtJS 4.0.7.

  2. There are two grids.

    But you can hide any column just by grabbing it using ComponentQuery.

    And you can lock/unlock by using the lock/unlock method of the locking grid passing the column.

  3. #2
    Sencha User Arg0n's Avatar
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    122
    Answers
    12
    Vote Rating
    16
    Arg0n will become famous soon enough Arg0n will become famous soon enough

      0  

    Default


    You could try something like: grid.column[1].hide() and grid.column[1].show()

  4. #3
    Sencha User
    Join Date
    Dec 2009
    Posts
    57
    Vote Rating
    0
    toole1 is on a distinguished road

      0  

    Default


    I tried that early on, but that does not work. With locking grids, it's like there are two grids in the DOM. One is called lockedGrid and one normalGrid. Each has a view and columns. I tried using hide, show and setVisible(false) on these columns, but it does not function. I noticed that when you use the column menu it works fine, so that's why I wondered if I could access the menu and run those options from with in my Javascript.

  5. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,506
    Answers
    13
    Vote Rating
    54
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    There are two grids.

    But you can hide any column just by grabbing it using ComponentQuery.

    And you can lock/unlock by using the lock/unlock method of the locking grid passing the column.

  6. #5
    Sencha User
    Join Date
    Dec 2010
    Posts
    3
    Vote Rating
    0
    hacocacyb is on a distinguished road

      0  

    Default


    If you have a grid, with nested columns, and it has locked columns, creating this scenario, when trying to hide/show columns, is it best to hide/show each of the sub columns or just the master column?

  7. #6
    Sencha User
    Join Date
    Dec 2009
    Posts
    57
    Vote Rating
    0
    toole1 is on a distinguished road

      0  

    Default


    Sorry, I thought I had tried that and it had not worked, but I tried it again and it works fine. I did:
    grid.down('#date5Column').hide();
    where date5Column is the itemId for the column.

    Locking and unlocking the the manual for 4.0.7, where I looked, appeared to be a private function and I wasn't sure if I should be using that.

    Thanks for your help.

  8. #7
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,506
    Answers
    13
    Vote Rating
    54
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    They are private, but they should be pretty stable. They are used by the lock and unlock menu items added when the grid is lockable. I can't see those methods ever going away.

Thread Participants: 3