##// END OF EJS Templates
tests moved under src/ folder...
tests moved under src/ folder removed requirejs dependency from the main source set

File last commit:

r49:1a91da7b15f7 di-typescript
r50:7a4fac383b10 di-typescript
Show More
_ModelBase.js
36 lines | 956 B | application/javascript | JavascriptLexer
/ src / main / js / data / _ModelBase.js
cin
changed the project structure
r49 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;
}
});
});