diff src/implab/data/_ModelBase.js @ 34:27e8e9e38e07 default tip

Слияние
author nickolay
date Wed, 05 Jun 2019 20:44:15 +0300
parents 8af8e840dd49 1dc2fd263b90
children
line wrap: on
line diff
--- a/src/implab/data/_ModelBase.js	Wed Jun 05 17:44:17 2019 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-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;
-        }
-        
-    });
-});
\ No newline at end of file