Show/Hide Grid HeaderItems Method

  1. #1

    Show/Hide Grid HeaderItems Method

    Just a minor request

    I use the following piece of code to show/hide a grid's Header Items. It'd be great if such a method could be added to the GridView and/or FilterHeader plugin, especially if it can be exposed server-side.

    /* Shows/Hides The header items on a grid */
    var showHideHeaderItems = function (grid, visible)
    {
        var cols = grid.getView().headerCt.items;
        for (var i = 0; i < cols.length; i++)
        {
            var colItems = cols.get(i).items;
    
    
            for (var headerItem = 0; headerItem < colItems.length; headerItem++)
            {
                if (visible)
                    colItems.get(headerItem).show();
                else
                    colItems.get(headerItem).hide();
            }
        }
    }
  2. #2
    Hi @pgodwin,

    Thank you for the suggestion. We will think about that.

    especially if it can be exposed server-side
    Please clarify are you able to call your showHideHeaderItems method from server side?
  3. #3
    Quote Originally Posted by Daniil View Post

    Please clarify are you able to call your showHideHeaderItems method from server side?
    I haven't tried yet, I don't see why it wouldn't work though.
  4. #4
    Yes, it should be not a problem. Just I was not sure it is a problem or not for you.

    I think we are not going to add it for v2. Maybe, for v3.

Similar Threads

  1. Replies: 11
    Last Post: Jul 25, 2013, 9:34 PM
  2. [2.0]Performance of grid headeritems.
    By howardyin in forum 2.x Help
    Replies: 0
    Last Post: Oct 30, 2012, 8:38 AM
  3. [CLOSED] Hide / Show columns in Grid - Razor
    By MTSI in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 30, 2012, 12:41 PM
  4. Replies: 1
    Last Post: Dec 28, 2011, 6:36 PM
  5. Replies: 0
    Last Post: Mar 03, 2011, 1:08 PM

Posting Permissions