Authors:Akira Sudoh, Ed Chatelain
Developers:Akira Sudoh, Ed Chatelain

dojox/mvc/EditStoreRefController is an inheritance of dojox/mvc/EditModelRefController and dojox/mvc/StoreRefController. In addition to what dojox/mvc/EditModelRefController and dojox/mvc/StoreRefController do, the commit() method sends the data model as well as the removed entries in array to the data store.


In below example, the check box refers to value property in the controller (with ctrl ID). The controller provides the value property, from the data coming from data store (store property in the controller), using the first one in array. Two seconds later, the check box changes from unchecked to checked. The change is committed to the data store, which is reflected to dojo/store/Observable callback.

    "dojo/dom", "dojo/parser", "dojo/when", "dojo/store/Observable", "dojo/store/Memory", "dijit/registry", "dojo/domReady!"
], function(ddom, parser, when, Observable, Memory, registry){
    store = Observable(new Memory({data: [{id: "Foo", value: false}]}));
    when(parser.parse(), function(){
        registry.byId("ctrl").queryStore().observe(function(object, previousIndex, newIndex){
            alert("ID: " + + ", value: " + object.value);
        }, true);
        var count = 0;
        var h = setInterval(function(){
            if(++count >= 2){ clearInterval(h); }
        }, 2000);
<script type="dojo/require">at: "dojox/mvc/at"</script>
<span id="ctrl"
 data-dojo-props="store: store"></span>
<input id="check" type="checkbox"
 data-dojo-props="checked: at('widget:ctrl', 'value')">
Error in the documentation? Can’t find what you are looking for? Let us know!