##// END OF EJS Templates
Added tag v1.4.3 for changeset d6fe22864d82
Added tag v1.4.3 for changeset d6fe22864d82

File last commit:

r51:43a2828f8abe v1.2.0-rc di-typescript
r168:10daa12056a8 v1.4.4 default
Show More
_ModelBase.js
36 lines | 956 B | application/javascript | JavascriptLexer
define(["dojo/_base/declare"], function(declare) {
return declare(null, {
dataContext : null,
idField : "id",
loaded : false,
constructor : function(opts){
if (opts) {
if(opts.dataContext)
this.dataContext = opts.dataContext;
if(opts.id)
this[this.idField] = opts.id;
}
},
getId : function() {
return this[this.idField];
},
attach : function(id, dc) {
if (this.dataContext)
throw new Error("The object is already attached");
this[this.idField] = id;
this.dataContext = dc;
},
isAttached : function() {
return this.dataContext ? true : false;
},
onPopulate : function() {
this.loaded = true;
}
});
});