好用的地区选择插件,支持两种区域选择方式:
1.自动完成(可使用上下键选择区域) 2.点击弹出区域选择面板(看最下方截图)
使用示例:
var region = $(".Select").EMRegion({ AutoCompleteTrigger:1, AutoCompleteData:"/EMArea/AutoComplete", InputKey:"input", SelectPanelData:"/EMArea/GetAreaByParentID", SelectParentKey:"parentID", RequestType:"jsonp", Delay:500, CommonRegion:[ {"ID":"1","Name":"北京市"}, {"ID":"22","Name":"天津市"}, {"ID":"868","Name":"上海市"}, {"ID":"2479","Name":"重庆市"}, {"ID":"1277","Name":"福州市","FullName":"福建省 福州市"} ] }); //设置初始值 region.Set(1277,"福建省 福州市");
服务端数据格式:
[{'ID':'123','Name':'example name','FullName':'example full name'},.....]