ExtJS - 다양한 Store

1806 단어 ExtJS
//ArrayStore
store: new Ext.data.ArrayStore({			
			fields:[
			        'sexTypeid',
			        'sexTypename'
			],
			data:[["MAN"," "],["WOMEN"," "],["NONE"," "]]
		})
//JsonStore
new Ext.data.JsonStore({
	root:'grid',
	url: 'getData.action',
	fields: ['id','name']
});
var store = new Ext.data.JsonStore({
	root : 'grid',
	proxy: new Ext.data.HttpProxy({ 
            url : 'getBdsbcxData.action',
            timeout: 120000 
        }),
	totalProperty: 'totalCount',
	//sortInfo : {field: "PXBM", direction: "ASC"},
	fields : ['SBMC','SSBDZMC','DYDJMC']
});	
//Store
var store = new Ext.data.Store({
	proxy: new Ext.data.HttpProxy({ 
            url : 'getSbjhtjMxb.action',
            timeout: 12000 
        }),
        reader : new App.JsonReader/* Ext.data.JsonReader*/({
        	root : 'grid'
        },['id', 'zbid', 'dwdm', 'dwmc'])
});	
/**
 *  JsonReader, store.reload(callback:function(){ })
 * @class App.JsonReader
 * @extends Ext.data.JsonReader
 */
App.JsonReader = Ext.extend(Ext.data.JsonReader, {
	    read : function(response){  
	        var json = response.responseText;  
	        var o = Ext.decode(json);  
	        this.responseText = json;//add by ljm   
	        if(!o) {  
	            throw {message: 'JsonReader.read: Json object not found'};  
	        }  
	        return this.readRecords(o);  
	    }  
	});
//App.JsonReader  
store.reload({
	params : {
	    bmStr : bmStr	   
	},
	callback:function(r,options,success){
	    myMask.hide();          
	    var resp = Ext.util.JSON.decode(store.reader.responseText);// 
        }

좋은 웹페이지 즐겨찾기