dojox
Version:
Dojo eXtensions, a rollup of many useful sub-projects and varying states of maturity – from very stable and robust, to alpha and experimental. See individual projects contain README files for details.
30 lines (25 loc) • 723 B
JavaScript
define([], function(){
var repeatmodel = null; //repeat view data model
// show an item detail
var setDetailsContext = function(index){
// only set the cursor if it is different and valid
if(parseInt(index) != repeatmodel.cursorIndex && parseInt(index) < repeatmodel.model.length){
repeatmodel.set("cursorIndex", parseInt(index));
}
};
return {
// repeat view init
init: function(){
repeatmodel = this.loadedModels.repeatmodels;
},
beforeActivate: function(){
// summary:
// view life cycle beforeActivate()
//
// if this.params["cursor"] is set use it to set the selected Details Context
if(this.params["cursor"]){
setDetailsContext(this.params["cursor"]);
}
}
}
});