I am using a NestedList with a base TreeStore. Now I want to add elements to the NestedList as leaves. How can i do this?
Currently my code (Controller, onAddButtonTapped) is as follows:
var store = Ext.getStore('menuStore'); var customerAreaNode = store.getRoot().getChildAt(1); customerAreaNode.appendChild({name: "text", leaf:true}); customerAreaNode.expand(); store.sync();
This code results in two new empty items at the sheet level (behind the correct node) and one new listener at the node level. Each new entry does not have names displayed in the NestedList, but each element contains βtextβ in the name field. Curiously, one of the new entries at the sheet level is not introduced into the base model. Thus, one could find methods suitable for the model:
Uncaught TypeError: Cannot call method 'getSelectedName' of undefined
Does anyone know a simple tutorial on how to add data to a NestedList / TreeStore? I could not find one good example in sencha touch docs.
source share