Results 1 to 3 of 3

Thread: Grid Panel Header problems

  1. #1
    Sencha User
    Join Date
    Nov 2012
    Vote Rating

    Default Grid Panel Header problems

    First, I am *not* referring to the column headers, but to the option to define a header for the grid itself, using the header: parameter.

    I had this working at one point so I know it's possible, but the project I was working on has undergone a lot of changes and is complex, so not knowing why it wasn't working I decided to start again with a simple example to confirm it worked as I expected.

    So, I opened up the Sencha Grid Example that comes with Ext 4.1 called 'Basic Array Grid'. Opening array-grid.js I added the following panel right before the grid:

    var pnHeader = Ext.create('Ext.form.Panel', {id: 'pnHeader', width: 200, html: 'world' });
    I then modified the grid as follow:

     var grid = Ext.create('Ext.grid.Panel', {
            store: store,
            stateful: true,
            collapsible: true,
            multiSelect: true,
            stateId: 'stateGrid',
            header: pnHeader,
            columns: [
                    text     : 'Company',
                    flex     : 1,
                    sortable : false,
                    dataIndex: 'company'
    //  AND SO ON... again, I just dropped this into the stock ext 4.1 example
    When I run it I get the following error: TypeError: el is undefined

    If I removed the header: pnHeader the error goes away and the grid loads.

    Interestingly in my larger project, I get no errors at all, it just doesn't display, so I figured I would step back to a simple set of code and test the header parameter there...

    Any help would be appreciated, I can't find anything about this parameter except the sencha docs which only have a single sentence describing its usage and in searching the sencha docs returns only information on column headers...

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


    Why not do something like:

    header   : {
        xtype : 'form',
        html  : 'world'
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2

    Think my support is good? Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services

    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.

  3. #3
    Sencha User
    Join Date
    Nov 2012
    Vote Rating

    Default That works

    Though I don't understand why I can't create the component ahead of time, but won't look a gift horse in the mouth since simply having it created dynamically as part of the grid will do just fine for my needs...

    Thanks for the response!


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts