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 |
Tags
- mac
- c#
- .net
- Store
- Request
- EFCore
- c#코딩의기술실전편
- intellij
- Config
- vscode
- JavaScript
- dbContext
- lazy loading
- 코드프로그래머스
- 명시적외래키
- error
- ORM
- React
- 상속
- scanner
- extraParams
- 대전본식영상
- minimalAPI
- LINQ
- 라도무스dvd
- ViewModel
- extjs
- JSON
- 에스가든스냅
- 스냅잘찍음
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>");
});