Login Register

adding

Dynamically adding items to FilteringSelect

Hello all,

I have a FilteringSelect which I have created from markup like so

<select dojoType="dijit.form.FilteringSelect" id="cmb1">
        <option value="1">aaa</option>
        <option value="2">bbb</option>
        <option value="3">ccc</option>
</select>

and now I want to add an Item dynamically to this list on the click of a button. I have tried the following.

var combo = dijit.byId("cmb1");
combo.store.newItem({text:"ddd", value:"4"}, null);

but I get the error "combo.store.newItem is not a function" in firebug.

Adding items to programatically created tree

Hi all,

I have an xml dom from which i create an ItemFileWriteStore datastore, which I use as the Store for my Tree, which i also programatically create like so

var tree = new dijit.Tree({
                                        persist:false,
                                        store: store,
                                        id: "myTree"
                                }, this.dojo.byId("myDivInsideMyContentPane");

inside a ContentPane. So far so good, the Tree displays all the Items as Nodes correctly.

Now I add an Item to the root of my Store like so

Syndicate content