1. #1
    Sencha Premium Member
    Join Date
    May 2011
    Posts
    8
    Vote Rating
    1
    andap is on a distinguished road

      1  

    Default Unanswered: Remove column from grid header context menu if hidden

    Unanswered: Remove column from grid header context menu if hidden


    Hello all,

    I am working with some hidden columns in my Grid:
    Code:
    column.setHidden(true)
    and I don't want them to be available to be chosen in the Grid column header menu where you can select which ones to display/hide. Is there a way to do this ?

    I believe the decision which ones to be displayed is done in the GridView method
    Code:
    protected Menu createContextMenu(final int colIndex)
    or am I wrong? Could anyone suggest how to override this method maybe to obtain the result I am looking for?

    I have attached a picture to better explain what I mean: so, the hidden ones should not appear in the highlighted menu.

    Thanks in advance,

    Anda
    Attached Images

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,645
    Answers
    107
    Vote Rating
    80
    Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice

      0  

    Default


    Hiding a column by unchecking it in that menu invokes .setHidden(true) on that column config, so that you can make the same changes (hiding and showing columns that are possible to display) from in code as from the UI.

    If you don't want a column shown at all, or even a possible part of the grid, remove it from the ColumnModel. Making a change like this after the grid has been rendered requires notifying the grid that a major change has been made, see GridView.refresh for more information.

  3. #3
    Ext GWT Premium Member
    Join Date
    Apr 2011
    Posts
    83
    Vote Rating
    0
    subendu is on a distinguished road

      0  

    Default Solution:

    Solution:


    Can be achieved by setting the columnHeader of the columnconfig object to be hidden to either null or empty string "".

  4. #4
    Sencha User
    Join Date
    Apr 2013
    Posts
    2
    Vote Rating
    0
    jgreer is on a distinguished road

      0  

    Default bump

    bump


    Does anyone know how to do this? If a column is hidden programmatically, how can you remove it or disable it in the column header menu?

  5. #5
    Sencha User
    Join Date
    Apr 2013
    Posts
    2
    Vote Rating
    0
    jgreer is on a distinguished road

      0  

    Default OK, replying to myself for the benefit of others

    OK, replying to myself for the benefit of others


    Code:
    grid.headerCt.on({
            menucreate: function(header, menu){
                var columnMenuItem = menu.getComponent('columnItem');
    
    
                columnMenuItem.menu.items.each(function(menuItem){
    
    
                    // Find the corresponding column.
                    var column = Ext.getCmp(menuItem.headerId);
    
    
                    // Hide or disable the menuItem based on the visiblity of the column.
                    menuItem.setVisible( column.isVisible() );
                });
            },
            scope: this
        });

  6. #6
    Sencha Premium Member
    Join Date
    Dec 2013
    Posts
    12
    Vote Rating
    0
    wellsfargouser is on a distinguished road

      0  

    Default Best answer to unshow hideen column in grid header context menu

    Best answer to unshow hideen column in grid header context menu


    To have a hidden, and unshowable column use.

    Code:
    hidden: true,
    hideable: false


    The hidden config hides it, the hideable config says whether to add it to the show/hide menu that the user sees.So that column will then be under programmatic control only to show or hide it, not user control.
    Last edited by wellsfargouser; 21 Feb 2014 at 11:58 AM. Reason: Formatting

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar