웹 개발/extjs4
                
              extjs grid dataStore onLoad 처리.
                팩트폭력배
                 2012. 4. 24. 17:10
              
                          
            extjs grid에서 dataStore를 모두 불러왔을때 이벤트 처리를 해야할 경우가 생겼다.
이전의 삽질을 바탕으로 listener를 먼저 생각했고, 이벤트는 onLoad, afterLoad 등 하다가 단순하게 load를 하니 작동한다.
            
                          
            
            이전의 삽질을 바탕으로 listener를 먼저 생각했고, 이벤트는 onLoad, afterLoad 등 하다가 단순하게 load를 하니 작동한다.
		// create the Data Store
		    store = Ext.create('Ext.data.Store', {
		        pageSize: 20,
		        model: 'QnA',
		        //remoteSort: true,
		        proxy: new Ext.data.HttpProxy({ 
		            extraParams : jQuery('form[name="searchForm"]').formParams(),
		            url: REMOTE_URL, 
		            reader: new Ext.data.JsonReader(
				{ root: 'datas', totalProperty: 'totalCount'}
			)}
		        ),
		        listeners: {
		            load: function(dataStore, rows, bool) {
 		                console.log(dataStore);
 		                console.log(rows);
 		                console.log(bool);
		            },
		            scope: this
		        }
		    });