1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    11
    Vote Rating
    0
    germallon is on a distinguished road

      0  

    Default Answered: Render Dataview inside a panel

    Answered: Render Dataview inside a panel


    Hi everyone,

    I'm trying to render a Dataview inside of a Panel, with no success.

    Code:
    Ext.define('amv.view.MainView', {
       extend: 'Ext.Panel',
       xtype: 'main',
       requires: [
          'Ext.TitleBar',
          'Ext.dataview.DataView'
          ],
       config: {
          items:[
             {
             xtype: 'titlebar',
             docked: 'top',
             title: 'MultiViewer',
             items: [
                {iconCls: 'add',  align: 'left', action: 'addDevice', id: 'addDeviceButton'},
                {iconCls: 'delete', align: 'right', action: 'clearAllDevices', id:'clearAllButton'}
                ]
              },
    
    
             {"html": "Test item 0"}, //shows as expected
              {xtype: "devgridview"},  //Here lies the problem..  This is NOT displayed!
              {"html": "Test item 1"} //shows as expected
             ]
        }
    });
    My Grid View is a simple DataView. Here's the code that defines it:

    Code:
    Ext.define('amv.view.DevGridView', {
       extend: 'Ext.DataView',
        xtype: "devgridview",
        store: {
           autoLoad: true,
           autoSync: true,
            fields: ['name', 'age'],
            data: [
                {name: 'Jamie Avins',  age: 100},
                {name: 'Rob Dougan',   age: 21},
                {name: 'Tommy Maintz', age: 24},
                {name: 'Jacky Nguyen', age: 24},
                {name: 'Ed Spencer',   age: 26}
            ]
        },
    
    
        itemTpl: '{name} is {age} years old'
    });
    What am I missing? Thank you in advance.

  2. try giving your MainView a config layout: 'fit'

    John

  3. #2
    Touch Premium Member BostonMerlin's Avatar
    Join Date
    Aug 2010
    Location
    Boston
    Posts
    520
    Answers
    20
    Vote Rating
    41
    BostonMerlin has a spectacular aura about BostonMerlin has a spectacular aura about BostonMerlin has a spectacular aura about

      0  

    Default


    try giving your MainView a config layout: 'fit'

    John
    I love being a dad (5 & 7), flying airplanes (KBED) and writing code (spaghetti).
    BostonMerlin aka John Bond aka JB
    See U @ SenchaCon '13

  4. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    11
    Vote Rating
    0
    germallon is on a distinguished road

      0  

    Default


    Thanks for the quick reply. I couldn't find the "full" layout. I'm guessing you meant to say "fit". In any case, I tried all the different layouts, and even docking my Dataview, but still no success.

  5. #4
    Touch Premium Member BostonMerlin's Avatar
    Join Date
    Aug 2010
    Location
    Boston
    Posts
    520
    Answers
    20
    Vote Rating
    41
    BostonMerlin has a spectacular aura about BostonMerlin has a spectacular aura about BostonMerlin has a spectacular aura about

      0  

    Default


    yea, meant 'fit'. also, try setting your mainviews scroll config to none.
    I love being a dad (5 & 7), flying airplanes (KBED) and writing code (spaghetti).
    BostonMerlin aka John Bond aka JB
    See U @ SenchaCon '13

  6. #5
    Sencha User
    Join Date
    Mar 2012
    Posts
    11
    Vote Rating
    0
    germallon is on a distinguished road

      0  

    Default


    Thanks.. still no luck!

  7. #6
    Touch Premium Member BostonMerlin's Avatar
    Join Date
    Aug 2010
    Location
    Boston
    Posts
    520
    Answers
    20
    Vote Rating
    41
    BostonMerlin has a spectacular aura about BostonMerlin has a spectacular aura about BostonMerlin has a spectacular aura about

      0  

    Default


    Did you check the browser for errors?
    I love being a dad (5 & 7), flying airplanes (KBED) and writing code (spaghetti).
    BostonMerlin aka John Bond aka JB
    See U @ SenchaCon '13

  8. #7
    Sencha User
    Join Date
    Mar 2012
    Posts
    11
    Vote Rating
    0
    germallon is on a distinguished road

      0  

    Default


    Yes, there are no errors. Not sure exactly how, but the problem seems to be fixed. Perhaps it was something being cached. Thanks for the help!

Thread Participants: 1

Tags for this Thread