Ext.define('State', {
extend: 'Ext.data.Model',
fields: [
{type: 'string', name: 'nevalue'},
{type: 'string', name: 'contents'}
]
}); var sheng = Ext.create('Ext.data.Store', {
model: 'State',
proxy: {
type: 'ajax',
actionMethods: {
read: 'POST'
},
url: h.url + '/t/101',
reader: {
type: 'json'
}
},
autoLoad: true
}); var shi = Ext.create('Ext.data.Store', {
model: 'State',
proxy: {
type: 'ajax',
actionMethods: {
read: 'POST'
},
url: h.url + '/t/102',
reader: {
type: 'json'
}
},
autoLoad: false
}); var xian = Ext.create('Ext.data.Store', {
model: 'State',
proxy: {
type: 'ajax',
actionMethods: {
read: 'POST'
},
url: h.url + '/t/103',
reader: {
type: 'json'
}
},
autoLoad: false
}); Ext.create("Ext.panel.Panel", {
renderTo: document.body,
width: 290,
height: 220,
title: "城市三级联动",
plain: true,
margin: '30 10 0 80',
bodyStyle: "padding: 45px 15px 15px 15px;",
defaults: {
autoScroll: true,
bodyPadding: 10
},
items: [{
xtype: "combo",
name: 'sheng',
id: 'sheng',
fieldLabel: '选择省',
displayField: 'contents',
valueField: 'nevalue',
store: sheng,
triggerAction: 'all',
queryMode: 'local',
minChars: 1 ,
editable: false,
emptyText: '',
blankText: '',
listeners: {
select: function (combo, record, index) {
try {
var parent = Ext.getCmp('shi');
var parent1 = Ext.getCmp("qu");
parent.clearValue();
parent1.clearValue();
parent.store.load({params: {id: this.value}});
}
catch (ex) {
Ext.MessageBox.alert("错误", "数据加载失败。");
}
}
}
},
{
xtype: "combo",
name: 'shi',
id: 'shi',
fieldLabel: '选择市',
displayField: 'contents',
valueField: 'nevalue',
store: shi,
triggerAction: 'all',
queryMode: 'local',
minChars: 1 ,
editable: false,
emptyText: '',
blankText: '',
listeners: {
select: function (combo, record, index) {
try {
var parent = Ext.getCmp("qu");
parent.clearValue();
parent.store.load({params: {id: this.value}});
}
catch (ex) {
Ext.MessageBox.alert("错误", "数据加载失败。");
}
}
}
},
{
xtype: "combo",
name: 'qu',
id: 'qu',
fieldLabel: '选择区',
displayField: 'contents',
valueField: 'nevalue',
store: xian,
triggerAction: 'all',
queryMode: 'local',
minChars: 1 ,
editable: false,
emptyText: '',
blankText: ''
}
]
})

最新文章

  1. hibernate关联映射
  2. Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException:
  3. VI的一些快捷键
  4. 理解Docker容器的进程管理
  5. c#初学-多线程中lock用法的经典实例
  6. TortoiseSVN使用教程
  7. 一些代码 II (ConfigParser、创建大文件的技巧、__getattr__和__getattribute__、docstring和装饰器、抽象方法)
  8. ahjesus linux连接阿里云ubuntu服务器并更改默认账号和密码,以及创建子账户
  9. 关于移动端click事件绑定的一个细节
  10. 设置正确的post数据格式
  11. android studio修改新项目package名称
  12. Object-C编译的Protobuf
  13. apache开源项目--Apache Commons Imaging
  14. 从 mian 函数开始一步一步分析 nginx 执行流程(四)
  15. 列存储段消除(ColumnStore Segment Elimination)
  16. freeMarker遍历map的正确方式
  17. 恶补web之二:css知识(3)
  18. web框架实现购物车数量加减
  19. vue中的页面渲染方案
  20. Html5 手机端网页

热门文章

  1. 子元素设置margin-top后,父元素跟随下移的问题
  2. 人生苦短,我用Python!
  3. 复利计算1.0,2.0,3.0(java)
  4. 201621123037 《Java程序设计》第13周学习总结
  5. 2."结对项目"的心得体会
  6. [CB] Windows10为什么质量变差 bug越来越多
  7. gearman参数说明
  8. php中扩展pecl与pear
  9. webgl 背面剔除
  10. 内存测试——内存泄露工具 LeakCanary