// Kicks off instantiation of this controller, in a similar manner as dijit/_WidgetBase.postscript().
// Kicks off instantiation of this controller, in a similar manner as dijit/_WidgetBase.postscript().
// params: Object?
// params: Object?
// The optional parameters for this controller.
// The optional parameters for this controller.
// srcNodeRef: DOMNode?
// srcNodeRef: DOMNode?
// The DOM node declaring this controller. Set if this controller is created via Dojo parser.
// The DOM node declaring this controller. Set if this controller is created via Dojo parser.
this.inherited(arguments);
this.inherited(arguments);
srcNodeRef&&srcNodeRef.setAttribute("widgetId",this.id);// If this is created via Dojo parser, set widgetId attribute so that destroyDescendants() of parent widget works
srcNodeRef&&srcNodeRef.setAttribute("widgetId",this.id);// If this is created via Dojo parser, set widgetId attribute so that destroyDescendants() of parent widget works
},
},
startup:function(){
startup:function(){
// summary:
// summary:
// A function called after the DOM fragment declaring this controller is added to the document, in a similar manner as dijit/_WidgetBase.startup().
// A function called after the DOM fragment declaring this controller is added to the document, in a similar manner as dijit/_WidgetBase.startup().
var_self=this;
var_self=this;
this.own(router.register(/.*/,function(e){// Register a route handling callback for any route, make sure it's cleaned up upon this controller being destroyed
this.own(router.register(/.*/,function(e){// Register a route handling callback for any route, make sure it's cleaned up upon this controller being destroyed
// Removes a todo item having the given unique ID.
// Removes a todo item having the given unique ID.
// uniqueId: String
// uniqueId: String
// The unique ID of the todo item to be removed.
// The unique ID of the todo item to be removed.
varmodel=this[this._refModelProp],
varmodel=this[this._refModelProp],
indices=array.filter(array.map(model,function(item,idx){returnitem.uniqueId==uniqueId?idx:-1;}),function(idx){returnidx>=0;});// The array index of the todo item to bd removed
indices=array.filter(array.map(model,function(item,idx){returnitem.uniqueId==uniqueId?idx:-1;}),function(idx){returnidx>=0;});// The array index of the todo item to bd removed
if(indices.length>0){
if(indices.length>0){
model.splice(indices[0],1);
model.splice(indices[0],1);
}
}
},
},
removeCompletedItems:function(){
removeCompletedItems:function(){
// summary:
// summary:
// Removes todo items that have been marked as complete.
// Removes todo items that have been marked as complete.
varmodel=this[this._refModelProp];
varmodel=this[this._refModelProp];
for(vari=model.length-1;i>=0;--i){
for(vari=model.length-1;i>=0;--i){
if(model[i].get("completed")){
if(model[i].get("completed")){
model.splice(i,1);
model.splice(i,1);
}
}
}
}
},
},
markAll:function(/*Boolean*/markComplete){
markAll:function(/*Boolean*/markComplete){
// summary:
// summary:
// Mark all todo items as complete or incomplete.
// Mark all todo items as complete or incomplete.
// markComplete: Boolean
// markComplete: Boolean
// True to mark all todo items as complete. Otherwise to mark all todo items as incomplete.
// True to mark all todo items as complete. Otherwise to mark all todo items as incomplete.
// A dojox/mvc data converter, that does one-way conversion that returns whether we have less than n todo items in a specific state, where n is the given number in data converter options.
// A dojox/mvc data converter, that does one-way conversion that returns whether we have less than n todo items in a specific state, where n is the given number in data converter options.
// Data converter options can be specified by setting constraints property in one of data binding endpoints.
// Data converter options can be specified by setting constraints property in one of data binding endpoints.
// See data converter section of dojox/mvc/sync library's documentation for more details.
// See data converter section of dojox/mvc/sync library's documentation for more details.