Threaded 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
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