SpringMVC注解类@RequestParam结合extjs的使用示例。
java:
@ResponseBody
@RequestMapping(value = "/address", method = RequestMethod.POST)
public List<Map<String,String>> address(@RequestParam("c") String column,
@RequestParam(value="parentValue",required = false) String parentValue,
@RequestParam(value="emptyOption",required = false) String emptyOption) {
Map<String,String> params = new HashMap<String,String>();
params.put("tableName", "ADDRESS");
params.put("columnName", column); //此处column的值为:PROVINCE
extjs:
//省 从字典中取的下拉框
Ext.define('cdkj.store.common.ProvinceComboStore', {
extend : 'Ext.data.Store',
storeId: 'provinceStore',
model : 'cdkj.model.common.ComboxModel',
autoLoad:true,
proxy : {
type : 'ajax',
url : base + '/com/sys/dictionary/address.html',
extraParams:{
t:'ADDRESS',
c:'PROVINCE'
},
reader : {
type : 'json',
successProperty : 'success'
},
actionMethods : {
read : 'POST'
}
}
});