define([ "dojo/_base/declare", "dojo/_base/lang", "./getPlainValue", "./EditStoreRefController", "./ListController" ], function(declare, lang, getPlainValue, EditStoreRefController, ListController){ return declare("dojox.mvc.EditStoreRefListController", [EditStoreRefController, ListController], { // summary: // A child class of dojox/mvc/EditStoreRefController, mixed with ListController. // description: // It supports Lists in addition to what dojox/mvc/EditStoreRefController does. // NOTE - If this class is used with a widget by data-dojo-mixins, make sure putting the widget in data-dojo-type and putting this class to data-dojo-mixins. // 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. // | // |
// | // | // | // | // | // | // | // | // | commitCurrent: function(){ // summary: // Send the change back to the data source for the current index. var id = this.cursor[this.idProperty]; for(var i = 0; i < this.originalModel.length; i++){ if(this.originalModel[i][this.idProperty] == id){ this.originalModel.set(i, this.cloneModel(this.cursor)); break; } } this.store.put(this.cursor); } }); });