Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
Tags
- EFCore
- 상속
- ViewModel
- intellij
- scanner
- LINQ
- c#
- inserttrigger
- lazy loading
- JSON
- minimalAPI
- JavaScript
- 코드프로그래머스
- c#코딩의기술실전편
- extraParams
- ORM
- ""+n
- Store
- Config
- 명시적외래키
- mac
- dbContext
- Request
- .net
- React
- error
- vscode
- DbSave
- extjs
- 자원정리
Archives
- Today
- Total
ejyoo's 개발 노트
정적속성 본문
정적속성은 생성된 모든 객체가 공유하며 클래스의 인스턴스 명, 정적속성 방식 또는 statics()를 이용하여 사용한다.
자바에서 static과 동일하다
* 기본 형태
statics:{
속성,
메소드
}
* 예제 :
* 결과
2
2
-----------end
Ext.onReady(function(){
Ext.define('CountTest',{
config:{
name:null
},
constructor:function(config){
this.initConfig(config);
}
});
Ext.define('extendsCountTest',{
extend:'CountTest',
statics:{
count:0
},
addCount:function(){
this.statics().count++;
},
getCount:function(){
return this.statics().count;
}
});
var test1 = Ext.create('extendsCountTest',{
name:'test1'
});
test1.addCount();
var test2 = Ext.create('extendsCountTest',{
name:'test2'
});
test2.addCount();
document.write(test1.getCount() + "<br>");
document.write(test2.getCount() + "<br>");
});