[CLOSED] Removing extra columns from the menu of a gridpanel

  1. #1

    [CLOSED] Removing extra columns from the menu of a gridpanel

    Hi,
    I have gridpanel, based on some conditions i will be showing/hiding some of the columns. But the hidden columns can be unhide anytime using the menu option. Please find the attached image below. Let me know what property to be set to remove the hidden columns from the menu list.

    Attached Thumbnails gpj.png  
    Last edited by Daniil; Jan 16, 2015 at 9:20 AM. Reason: [CLOSED]
  2. #2
    Hello,

    Inside your gridpanel define a listener to customize the context menu:

            <Listeners>
                <ViewReady Handler="customMenu(this);" />
            </Listeners>
    The handler function accesses the context menu and hides the first and second column checkbox options:

            <script type="text/javascript">
                var customMenu = function(obj) {
                    var menu = obj.getView().headerCt.getMenu();                     
                    menu.items.get('columnItem').menu.items.get(0).hide();
                    menu.items.get('columnItem').menu.items.get(1).hide();
                }
            </script>
    Hope it helps.

Similar Threads

  1. Replies: 5
    Last Post: Jan 08, 2015, 10:55 AM
  2. Replies: 2
    Last Post: Jul 16, 2012, 5:26 AM
  3. Replies: 6
    Last Post: Jan 17, 2012, 12:38 PM
  4. Replies: 2
    Last Post: May 19, 2010, 4:07 PM
  5. [CLOSED] Grid adding removing columns in codebehind
    By methode in forum 1.x Premium Help
    Replies: 6
    Last Post: Feb 24, 2009, 2:51 AM

Tags for this Thread

Posting Permissions