Hybrid View
-
8 Oct 2012 1:34 PM #1
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
- Chrome Version 22.0.1229.79 m
- Safari 5.1.7
- <!DOCTYPE html>
Using the nested list store config results in the wrong store object being created.
End up with the following JS error:
Steps to reproduce the problem:Code:Uncaught TypeError: Object [object Object] has no method 'getRoot'
- See reproducer
- Store confing should result in a Ext.data.TreeStore being created and therefore the getRoot() method will be defined
- I suspect that the store is being instantiated as the superclass Ext.data.Store instead
HELPFUL INFORMATIONCode: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 } }); } });
Additional CSS used:- only default ext-all.css
- Win 7
-
9 Oct 2012 5:28 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,635
- Vote Rating
- 435
Thanks for the report.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
11 Oct 2012 7:38 AM #3Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Haarlem, Netherlands
- Posts
- 1,235
- Vote Rating
- 4
This has been fixed for the next release.
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-3554
in
Sprint 26 (2.1.0-rc2).


Reply With Quote
