글

라벨이 Extjs인 게시물 표시

extjs form submit - iframe 대체 - 엑셀 다운로드 구현

var hiddenForm = Ext.create('Ext.form.Panel', {  title:'hiddenForm',  standardSubmit: true,  url: myhost + "/excel.do",  timeout: 120000,  height:0,  width: 0,  hidden:true,  items:[    {xtype:'hiddenfield', name:'token', value:token},    {xtype:'hiddenfield', name:'param', value:JSON.stringify(param)}  ] }); hiddenForm.getForm().submit() standardSubmit: true, ==> iframe과 동일하게 다운로드를 구현할 수 있음. 즉 iframe 의 post호출 버전 쯤 될듯. form 의 item 부분에 원하는 파라미터 값을 매핑해서 채워준뒤 submit하게 됨. 엑셀 저장 다운로드 구현시 사용 하면 유용 함.!!

ExtJs Store to Json convert

getJsonDataForStore: function(store){         var data = new Array();         var result = "";         var records = store.getRange();         for (var i = 0; i < records.length; i++) {             data .push(records[i].data);         }         result = Ext.JSON.encode(data );         return result ;     },

자바스크립트 function override callparent 사용하기

자바스크립트 function override callparent 사용하기(replace All 포함) setValue: function(value){     var me = this; --비지니스--     me.superclass.setValue.call(me, value); }, getValue: function(){     var me = this;     var result = me.superclass.getValue.call(me);     result = result.split("-").jojn(""); -- "-"제거     result = result.split(",").join("");     return result; },

Extjs filefield관련 참고 예제(파일업로드)

var formPanel = Ext . create ( 'Ext.form.Panel' , { renderTo : 'testdiv' , title : 'MyForm' , id : 'testCase' , items : [ { xtype : 'textfield' , name : 'title' , fieldLabel : 'Title' }, { xtype : 'panel' , layout : 'fit' , border : false , items : [{ xtype : 'filefield' , buttonOnly : true , name : 'file' , onChange : function ( value ) { var panel = this . ownerCt ; formPanel . submit ({ url : 'upload.json' , waitMsg : 'Uploading the image ..' , clientValidation : false , success : Ext . Function . bind ( panel . o...

Extjs 그리드(Grid) 틀고정- "Locked"

locked : boolean 그리드 config 값 중에서 틀정 칼럼의 틀고정 기능을 사용하기 위해서 설정 한다. Ext.define('gridX',{         extened: 'Ext.panel',         alias: 'xxx',         title: 'grid', columns:  { defaults: { width: 100 }, items: [{ xtype: 'rownum', locked: true, --> 틀고정 width: 10 }] }

Extjs 필드 validation관련-전화번호,사업자,이메일

전화번호 밸리데이션 { name : 'tel', // 전화번호 fieldLabel : "TEL", maxLength : 20, enforceMaxLength: true, // 입력란 길이 제한 regex: /^[0-9,-]{0,30}$/, regexText: ' 전화번호 는 숫자와 - 를 입력 할 수 있습니다.',    validator: function(v) {         return /^[0-9,-]{0,30}$/.test(v)?true:"NOTICE";    } } 사업자번호 밸리데이션 { name : 'bsno', // 사업자번호 fieldLabel : "BSNO", maxLength : 12, enforceMaxLength: true, // 입력란 길이 제한 readOnly : false,    regex: /^[0-9]{3}[\- ]?[0-9]{2}[\- ]?[0-9]{5}$/,        regexText: ' 사업자번호 는 숫자와 - 를 입력할 수 있습니다.',    validator: function(v) {         return /^[0-9]{3}[\- ]?[0-9]{2}[\- ]?[0-9]{5}$/.test(v)?true:"NOTICE";    },        listeners: {        change:function(me,newVal,oldVal){         if(typeof(old...

ExtJS 4 – bindStore vs reconfigure 두가지 사용법

내용상으로는  마스터 디테일 구조에서 디테일쪽 데이터 구조를 연결하는 2가지 방법입니다. 1. bindStore  myForm.loadRecord(myRecord); myGrid.getView().bindStore(myRecord.getAssociatedStore()); 2. reconfigure   myGrid.reconfigure(myRecord.getAssociation(), columnConfig); myGrid.getStore.sort("id", "ASC"); myGrid.getView().refresh();

JavaScript replace() Method

replace() Method 예제 "일이삼사오" var str=" 일이삼사오 "; var n=str.replace("이삼","오야"); result "일오야사오" slice(st,en); substr(a,b); 비슷함.

펌) The JavaScript experience: Extjs.util.MixedCollection : how to sort ?

펌) MixedCollection  소트(sort)하기 The JavaScript experience: Extjs.util.MixedCollection : how to sort ? : ks to this post

Extjs 4 Store 관련 - 기본파라미터 적용. - extraParams

extraParams   스토어에서 autoLoad = true 설정 된 경우 페이지 로딩 되면 자동으로 호출하게 되는데 조회 할 때  파라미터 값을 적용 하게 할 경우 아래와 같이 extraParams  를 설정 하면 된다. Ext.define('project.store.MyStore, { extend: 'project.store.BaseStore', model: 'project.model.MyStore', // autoLoad: false, proxy: { api : { create: contextPath + '/my/add.json', read: contextPath + '/my/list.json', update: contextPath + '/my/update.json', destroy: contextPath + '/my/delete.json' }, extraParams  : { 'myid': 'myid', 'myAuth': login.myAuth } }/*     listeners: {         beforeload: function(store, operation, options){             console.log( operation )         }     }*/ });

Extjs4 Model(데이터모델) 관련 config 속성

이미지
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.Model field 속성 config 에는 convert & serialize 실제 속성이 string으로 정의 된 칼럼을 컨버트해서 date형식으로 보여주고 실제 Sync시에는 스트링으로 Sync 하도록 처리 가능하다. convert: Ext.util.Format.stringToDate, serialize: Ext.util.Format.dateToString ex) fields:{    {name: 'resistDate' , type: 'string', convert: Ext.util.Format.stringToDate, serialize: Ext.util.Format.dateToString} } useNull = 숫자형이나 null을 허용 ex) {name: 'qty' , type: 'int', useNull: true}, persist = sync시 밸류값 제외 ex) {name: 'namedesc' , type: 'string', persist: false}

extjs4.1 이벤트 추가 관련

자바스크립트 클래스 define안에 이벤트 정의 방법 define안에 function 추가 result : function(records) { var onPopSelectFn = this.onPopSelect; if (Ext.isFunction(onPopSelectFn)) { onPopSelectFn.call(this, this.owner, records); } this.close(); } define안에서 필요 액션에 펑션을 호출 --> this.result(selected); view파일안에         -> 이벤트 호출 정의 onPopSelect: function(field, record){ field.setValue(record.get('name')); field.ownerCt.down('[name=code]').setValue(record.get('code')); } 위와 같은 코드는 추가된 onPopSelect로서 동작한다. 필요한 액션이 수행되면 자동으로 이벤트가 돌도록 처리 된다.
이미지
Extjs4 - function 관련 methods 중  Call 이란 methods 링크 http://arongi.net/extjs-4.1.1/docs/index.html#!/api/Function-method-call