[CLOSED] Command Column

  1. #1

    [CLOSED] Command Column

    Hi guys,

    what would be the equivalent to the code below, works in version 1 but not in 2.0. not able to get column model.


    var prepare = function (grid, toolbar, rowIndex, record) {
        var firstButton = toolbar.items.get(0),
            cm = grid.getColumnModel(),
            width = cm.getColumnWidth(cm.getIndexById("CommandColumn1"));
                 
        firstButton.setWidth(width);
    };
    Last edited by Daniil; Aug 23, 2012 at 4:55 AM. Reason: [CLOSED]
  2. #2
    Hi,

    The ColumModel became just the Columns collection, an Ext.grid.header.Container instance.
    http://docs.sencha.com/ext-js/4-1/#!/api/Ext.grid.header.Container

    Now the Columns are the controls. I mean that you can access them as common controls via client ids.

    The following should work. The "App" is the default Namespace. If you changed it, you should changed it in the code below as well.

    Example
    var prepare = function (grid, toolbar, rowIndex, record) {
        var firstButton = toolbar.items.get(0);
                  
        firstButton.setWidth(App.CommandColumn1.getWidth());
    };
  3. #3
    Hi,

    Please mark as closed.

Similar Threads

  1. [CLOSED] Command Column
    By RCM in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Aug 16, 2012, 4:43 AM
  2. Add command column in gridpanel
    By tmducit in forum 1.x Help
    Replies: 1
    Last Post: May 27, 2011, 11:27 AM
  3. GridPanel Column Command?
    By peter.campbell in forum 1.x Help
    Replies: 1
    Last Post: Apr 08, 2011, 9:13 AM
  4. command column messing up grid column
    By wp_joju in forum 1.x Help
    Replies: 2
    Last Post: Dec 08, 2010, 6:40 AM
  5. [CLOSED] Treegrid Command Column
    By sharif in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Sep 27, 2010, 6:41 PM

Posting Permissions