I'm having trouble redrawing my nested list using sencha touch 2. My code looks something like this:
var data = {items:[{text:'hello', leaf:true}]}; Ext.application({ name:'main', launch:function(){ Ext.define('ListItem', { extend: 'Ext.data.Model', config: { fields: ['text'] } }); var treeStore = Ext.create('Ext.data.TreeStore', { id: 'mystore', model: 'ListItem', defaultRootProperty: 'items', root: data}); Ext.create('Ext.NestedList', { id:'mylist', fullscreen: true, store: treeStore }); }
At run time, I change the data variable like this: data.items[0].text = 'bye'
. How to get a list of attached files for updating and show bye
? I tried the following, but none of them work:
var mystore = Ext.data.StoreManager.lookup('mystore'); mystore.setRoot(data); Ext.getCmp('mylist').refresh(); // refresh, update, dolayout, repaint etc... does not exist. Ext.getCmp('mylist').bindstore(mystore); // bindstore is deprecated
source share