mbalsam
6 Jul 2011, 11:20 PM
Sencha Touch version tested:
1.1.0 (with PhoneGap)
only default ext-all.css
Platform tested against:
iOS 4
OSX (Chrome, Safari)
Description:
TreeStore with autoLoad property set to false
TreeStore used as store property of a NestedList
When the NestedList is instantiated the TreeStore automatically loads
Test Case:
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
}]
},{
text: 'Empty Category',
items: []
}]
};
Ext.regModel('ListItem', {
fields: [{name: 'text', type: 'string'}]
});
var store = new Ext.data.TreeStore({
autoLoad: false,
model: 'ListItem',
root: data,
proxy: {
type: 'ajax',
reader: {
type: 'tree',
root: 'items'
}
},
listeners: {
beforeLoad: function() {
console.log('You didn't say store.load(), did you?');
}
}
});
var nestedList = new Ext.NestedList({
fullscreen: true,
title: 'Groceries',
displayField: 'text',
store: store
});
See this URL : http://
Steps to reproduce the problem:
Implement a TreeStore with autoLoad set to false
Use the TreeStore as a NestedList's store
Instantiate the NestedList
The result that was expected:
TreeStore does NOT load automatically
NestedList should not be responsible for loading the store (see e.g. List)
The result that occurs instead:
TreeStore loads automatically
Screenshot or Video:
no
Debugging already done:
NestedList.initComponent calls NestedList.getSubList which calls NestedList.getListConfig which finally calls NestedList.store.getSubStore. At this point the TreeStore loads.
Possible fix:
not provided
1.1.0 (with PhoneGap)
only default ext-all.css
Platform tested against:
iOS 4
OSX (Chrome, Safari)
Description:
TreeStore with autoLoad property set to false
TreeStore used as store property of a NestedList
When the NestedList is instantiated the TreeStore automatically loads
Test Case:
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
}]
},{
text: 'Empty Category',
items: []
}]
};
Ext.regModel('ListItem', {
fields: [{name: 'text', type: 'string'}]
});
var store = new Ext.data.TreeStore({
autoLoad: false,
model: 'ListItem',
root: data,
proxy: {
type: 'ajax',
reader: {
type: 'tree',
root: 'items'
}
},
listeners: {
beforeLoad: function() {
console.log('You didn't say store.load(), did you?');
}
}
});
var nestedList = new Ext.NestedList({
fullscreen: true,
title: 'Groceries',
displayField: 'text',
store: store
});
See this URL : http://
Steps to reproduce the problem:
Implement a TreeStore with autoLoad set to false
Use the TreeStore as a NestedList's store
Instantiate the NestedList
The result that was expected:
TreeStore does NOT load automatically
NestedList should not be responsible for loading the store (see e.g. List)
The result that occurs instead:
TreeStore loads automatically
Screenshot or Video:
no
Debugging already done:
NestedList.initComponent calls NestedList.getSubList which calls NestedList.getListConfig which finally calls NestedList.store.getSubStore. At this point the TreeStore loads.
Possible fix:
not provided