1. #1
    Sencha User
    Join Date
    Mar 2011
    Posts
    10
    Vote Rating
    0
    matteoli is on a distinguished road

      0  

    Question ColumnModel in Ext JS 4

    ColumnModel in Ext JS 4


    Hi,

    I am wondering how to instantiate a ColumnModel of a GridPanel in Ext JS 4? Is this not implemented currently or do I have to use another class?

    In Ext JS 3 the following lines worked well but failing in Ext JS 4 with the error that there is no such constructor in this class:

    Code:
    colModel = new Ext.grid.ColumnModel({
      defaults: {
        align: 'left',
        risizable: false,
        sortable: false,
        width: 150
      }
    });
    Thanks in advance!
    Oliver

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,075
    Vote Rating
    467
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    This forum requires that you post the same question at least 4 times before there is a reply.

    Regards,
    Scott.

  3. #3
    Sencha User
    Join Date
    Mar 2011
    Posts
    10
    Vote Rating
    0
    matteoli is on a distinguished road

      0  

    Lightbulb


    OK, OK.
    I thought the preview button would not publish the post to the forum.
    sorry.

  4. #4
    Sencha - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    2,759
    Vote Rating
    108
    mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all

      0  

    Default


    ColumnModel seems to have been replaced by 'headers'. See this example http://dev.sencha.com/deploy/ext-4.0...rray-grid.html

    Code:
    // create the Grid
        var grid = new Ext.grid.GridPanel({
            store: store,
            columnLines: true,
            headers: [
                {
                    text     : 'Company',
                    flex     : 1,
                    sortable : false, 
                    dataIndex: 'company'
                },
                {
                    text     : 'Price', 
                    width    : 75, 
                    sortable : true, 
                    renderer : 'usMoney', 
                    dataIndex: 'price'
                },
                {
                    text     : 'Change', 
                    width    : 75, 
                    sortable : true, 
                    renderer : change, 
                    dataIndex: 'change'
                },
                {
                    text     : '% Change', 
                    width    : 75, 
                    sortable : true, 
                    renderer : pctChange, 
                    dataIndex: 'pctChange'
                },
                {
                    text     : 'Last Updated', 
                    width    : 85, 
                    sortable : true, 
                    renderer : Ext.util.Format.dateRenderer('m/d/Y'), 
                    dataIndex: 'lastChange'
                }
            ],
            height: 350,
            width: 600,
            title: 'Array Grid',
            renderTo: 'grid-example',
            viewConfig: {
                stripeRows: true
            }
        });

  5. #5
    Sencha User
    Join Date
    Mar 2011
    Posts
    10
    Vote Rating
    0
    matteoli is on a distinguished road

      0  

    Default


    That might be. Do you know, what class is behind the headers? I have to instantiate it by myself, because the columns should be initialized by a dynamic backend.

  6. #6
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,327
    Vote Rating
    850
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    A Header extends Ext.Component.
    http://dev.sencha.com/deploy/ext-4.0...id.Header.html

    There is also HeaderContainer that wraps all the Headers which extends Ext.container.Container.
    http://dev.sencha.com/deploy/ext-4.0...Container.html
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  7. #7
    Sencha User
    Join Date
    May 2007
    Location
    Germany
    Posts
    73
    Vote Rating
    1
    AlxH is on a distinguished road

      0  

  8. #8
    Sencha User
    Join Date
    Apr 2011
    Posts
    6
    Vote Rating
    0
    rhelms is on a distinguished road

      0  

    Default colModel in Extjs 4 beta2

    colModel in Extjs 4 beta2


    In ExtJs 4 beta2, gridPanel.colModel seems to have been replaced by headerCt, although the generated documentation does not reflect this.

  9. #9
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,327
    Vote Rating
    850
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Headers are now back to Columns but you still have HeaderContainer. RC should be coming soon
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  10. #10
    Sencha User
    Join Date
    Apr 2011
    Posts
    6
    Vote Rating
    0
    rhelms is on a distinguished road

      0  

    Default


    Awesome. I'm really new to ExtJS, and thought if I'm going to use it long term, I may as well start with the beta. By the time I'm ready to use it commercially, it may be at final release.

Similar Threads

  1. [ColumnModel]
    By oneTETSUO in forum Ext GWT: Discussion
    Replies: 2
    Last Post: 7 Oct 2010, 8:26 AM
  2. how to set ColumnModel by rpc
    By charmw in forum Ext GWT: Discussion
    Replies: 5
    Last Post: 30 Dec 2009, 2:41 AM
  3. Quicktips on ColumnModel
    By tiaquis in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 31 Jan 2008, 2:43 AM
  4. Bug in ColumnModel
    By Animal in forum Ext 1.x: Bugs
    Replies: 4
    Last Post: 25 Sep 2007, 7:38 AM
  5. IE6 and ColumnModel
    By Artur Bodera (Joust) in forum Ext 1.x: Bugs
    Replies: 3
    Last Post: 27 Apr 2007, 5:53 AM

Thread Participants: 7