[CLOSED] Set column´s hideable property using JavaScript

  1. #1
    Attached Thumbnails Click image for larger version. 

Name:	hideColumn.jpg 
Views:	91 
Size:	15.9 KB 
ID:	4776  
    Last edited by Daniil; Sep 14, 2012 at 2:42 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Changing the hideable on the fly doesn't cause updating the menu.

    I can suggest the following solution.
    var grid = App.GridPanel1,
        col = grid.columns[1];
                                        
    col.hide();
    col.hideable = false;
    grid.headerCt.menu.destroy();
    delete grid.headerCt.menu;
    It causes the menu to be updated.
  3. #3
    Thumbs up to you Danill, please mark it as closed.
  4. #4
    Quote Originally Posted by Daniil View Post
    Hi,

    Changing the hideable on the fly doesn't cause updating the menu.

    I can suggest the following solution.
    var grid = App.GridPanel1,
        col = grid.columns[1];
                                        
    col.hide();
    col.hideable = false;
    grid.headerCt.menu.destroy();
    delete grid.headerCt.menu;
    It causes the menu to be updated.
    After updating from SVN, i noticed that it's not necessary to do the following anymore:
    grid.headerCt.menu.destroy();
    delete grid.headerCt.menu;
    So, we just have to hide the column and set hideable property to false, as shown below:
    var hideNameColumn = function () {
        var grid = App.GridPanel1, 
            col = grid.columns[1];
    
        col.hide();
        col.hideable = false;
    }
    Last edited by RCN; Aug 01, 2013 at 8:01 PM.
  5. #5
    Good to know. Thank you for the update, Raphael.
  6. #6
    You're welcome.

Similar Threads

  1. [OPEN] [#96] ColumnHeaderGroup Hideable columns
    By cwolcott in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Mar 12, 2013, 9:33 AM
  2. [CLOSED] get the cls property in javascript
    By rnfigueira in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 28, 2012, 1:40 PM
  3. [CLOSED] How to set a column's hideable property during a DirectEvent
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: May 23, 2011, 8:40 PM
  4. [CLOSED] how to set panel html property as javascript property
    By kenanhancer in forum 1.x Legacy Premium Help
    Replies: 10
    Last Post: Jan 05, 2011, 6:45 PM
  5. [CLOSED] Set AllowBlank Property with JavaScript
    By pdcase in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 21, 2010, 4:07 PM

Posting Permissions