var dd={"a":"=a","b":"=b","c":"=c","d":{"d1":"=d1","d2":"=d2"}};
輸出:
a:=a2
b:=b
c:=c
d:[object Object]
d1:=d1
d2:=d2
輸出:
isModified:function(A){return this.modified&&this.modified.hasOwnProperty(A)}
copy:function(A){return new this.constructor(Ext.apply({},this.data),A||this.id)}
clearError:function(){this.error=null}
hasError:function(){return this.error!=null}
getChanges:function(){var A=this.modified,B={};for(var C in A){if(A.hasOwnProperty(C)){B[C]=this.data[C]}}return B}
commit:function(A){this.dirty=false;delete this.modified;this.editing=false;if(this.store&&A!==true){this.store.afterCommit(this)}}
reject:function(B){var A=this.modified;for(var C in A){if(typeof A[C]!="function"){this.data[C]=A[C]}}this.dirty=false;delete this.modified;this.editing=false;if(this.store&&B!==true){this.store.afterReject(this)}}
endEdit:function(){this.editing=false;if(this.dirty&&this.store){this.store.afterEdit(this)}}
cancelEdit:function(){this.editing=false;delete this.modified}
beginEdit:function(){this.editing=true;this.modified={}}
get:function(A){return this.data[A]}
set:function(A,B){if(String(this.data[A])==String(B)){return }this.dirty=true;if(!this.modified){this.modified={}}if(typeof this.modified[A]=="undefined"){this.modified[A]=this.data[A]}this.data[A]=B;if(!this.editing&&this.store){this.store.afterEdit(this)}}
join:function(A){this.store=A}
modified:null
error:null
editing:false
dirty:false
id:1001
data:[object Object]
a:=a
b:=b
c:=c
d:[object Object]
d1:=d1
d2:=d2
綜合以上:定義一個JSON類: