Front desk:
var provinceStore = new Ext.data.Store( {
proxy: new Ext.data.HttpProxy({ url: basePath "/stationManage/station_getProvinceJSON.action" }),
reader: new Ext.data.JsonReader(
{ root: "" },
["PROVINCEID", "PROVINCENAME"]
)
});
//Select province and city
var provinceIDadd = new Ext.form.ComboBox({
anchor : '98%',
id:'provinceIDadd',
name : "provinceIDAdd1",
hiddenName : "provinceID",
displayField : "PROVINCENAME",
valueField : "PROVINCEID",
blankText : 'Please select the province where the site belongs',
emptyText : 'Please select the province where the site belongs',
fieldLabel : 'The province where the site belongs',
allowBlank : false,
editable : false,
triggerAction : 'all',
store :provinceStore ,
forceSelection : true,
mode : 'local',
selectOnFocus : true
})
provinceStore.load();
Background action code
public class StationAction extends BaseAction {
private List
strtus xml configuration
Load the drop-down selection box of static data
var dataType=[['0','8 columns'],['1','38 columns'],['2','21 columns']];
var dataTypeStore = new Ext. data.SimpleStore({
fields: ['dataTypeID', 'dataTypeName'],
data : data
});
var dataTypedd = new Ext.form.ComboBox({
anchor : '98%',
id:'dataTypeadd',
name : "dataTypeAdd1",
hiddenName : "dataType",
displayField : "dataTypeName",
valueField : "dataTypeID",
blankText : 'Please select the data format',
emptyText : 'Please select the data format',
fieldLabel : 'Data format',
allowBlank : false,
editable : false,
triggerAction : 'all',
store :unitStore ,
forceSelection : true,
mode : 'local',
selectOnFocus : true
})