This is model
Ext.regModel('commemModel', {
fields : [ 'name', 'id' ]
});
Define a store and set the default value of the container with id as s1 to the first quarter
var gjcx1 = new Ext.data.Store({
autoLoad:true ,
model : commemModel,
proxy : {
type : 'ajax',
url : '../store/cxjd.json'
},
listeners :{
load:function(){
Ext.getCmp('s1').setValue('q1');
}
}
});
The cxjd.json is given below
[
{name:'First Quarter',id:'q1'},
{name:'Second Quarter',id:'q2'},
{name:'Third Quarter' ,id:'q3'},
{name:'Q4',id:'q4'}
]