Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-3554 in a recent build.
  1. #1
    Touch Premium Member suzuki1100nz's Avatar
    Join Date
    Apr 2011
    Location
    New Zealand
    Posts
    450
    Vote Rating
    66
    suzuki1100nz is just really nice suzuki1100nz is just really nice suzuki1100nz is just really nice suzuki1100nz is just really nice

      0  

    Default Nested List store config - Wrong store type Sencha Touch 2.1.0-rc1

    Nested List store config - Wrong store type Sencha Touch 2.1.0-rc1


    REQUIRED INFORMATION

    Touch version tested:
    • Sencha Touch 2.1.0-rc1
    Browser versions tested against:
    • Chrome Version 22.0.1229.79 m
    • Safari 5.1.7
    DOCTYPE tested against:
    • <!DOCTYPE html>
    Description:
    Using the nested list store config results in the wrong store object being created.
    End up with the following JS error:

    Code:
    Uncaught TypeError: Object [object Object] has no method 'getRoot'
    Steps to reproduce the problem:
    • See reproducer
    The result that was expected:
    • Store confing should result in a Ext.data.TreeStore being created and therefore the getRoot() method will be defined
    The result that occurs instead:
    • I suspect that the store is being instantiated as the superclass Ext.data.Store instead
    Test Case:

    Code:
    Ext.application({
        name: 'Test',
        viewport: { preventZooming: true },
        launch: function () {
    
    
          var data = {
              text: 'Groceries',
              items: [{
                  text: 'Drinks',
                  items: [{
                      text: 'Water',
                      items: [{
                          text: 'Sparkling',
                          leaf: true
                      }, {
                          text: 'Still',
                          leaf: true
                      }]
                  }, {
                      text: 'Coffee',
                      leaf: true
                  }, {
                      text: 'Espresso',
                      leaf: true
                  }, {
                      text: 'Redbull',
                      leaf: true
                  }, {
                      text: 'Coke',
                      leaf: true
                  }, {
                      text: 'Diet Coke',
                      leaf: true
                  }]
              }, {
                  text: 'Fruit',
                  items: [{
                      text: 'Bananas',
                      leaf: true
                  }, {
                      text: 'Lemon',
                      leaf: true
                  }]
              }, {
                  text: 'Snacks',
                  items: [{
                      text: 'Nuts',
                      leaf: true
                  }, {
                      text: 'Pretzels',
                      leaf: true
                  }, {
                      text: 'Wasabi Peas',
                      leaf: true
                  }]
              }]
          };
    
    
          Ext.define('ListItem', {
              extend: 'Ext.data.Model',
              config: {
                  fields: [{
                      name: 'text',
                      type: 'string'
                  }]
              }
          });
    
    
          /*    var store = Ext.create('Ext.data.TreeStore', {
          model: 'ListItem',
          defaultRootProperty: 'items',
          root: data
          });*/
    
    
          var nestedList = Ext.create('Ext.NestedList', {
              fullscreen: true,
              title: 'Groceries',
              displayField: 'text',
              //store: store
                  store: {
                      model: 'ListItem',
                      defaultRootProperty: 'items',
                      root: data
                                
                    }
          });
        }
    });
    HELPFUL INFORMATION

    Additional CSS used:
    • only default ext-all.css
    Operating System:
    • Win 7

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,548
    Vote Rating
    872
    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


    Thanks for the report.
    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.

  3. #3
    Sencha User
    Join Date
    Mar 2007
    Location
    Haarlem, Netherlands
    Posts
    1,243
    Vote Rating
    10
    TommyMaintz will become famous soon enough TommyMaintz will become famous soon enough

      0  

    Default


    This has been fixed for the next release.

Thread Participants: 2