Ext.js5(自定义的下拉列表模板)(从服务器加载数据)(28)
来源:互联网 发布:淘宝联盟规则变更 编辑:程序博客网 时间:2024/05/02 12:29
view
/** * This example illustrates a combo box which loads the data source from a server * but queries the local result set. It uses a custom item template for the dropdown list. * 这个例子模拟了下拉框从服务器加载数据但是查询本地结果集。使用了自定义的下拉列表模板。 */Ext.define('KitchenSink.view.form.combobox.RemoteLoad', { extend: 'Ext.form.Panel', xtype: 'remote-loaded-combo', title: 'Remote loaded ComboBox', width: 500, layout: 'form', viewModel: {}, items: [{ xtype: 'fieldset', layout: 'anchor', items: [{ xtype: 'component', anchor: '100%', html: [ '<h3>Remote loaded, local query mode</h3>', '<p>This ComboBox uses remotely loaded data, to perform querying ', 'client side.</p>', //适用于数据并非太大或者动态的操控 '<p>This is suitable when the dataset is not too big or dynamic ', 'to be manipulated locally.</p>', '<p>This example uses a custom template for the dropdown list ', 'to illustrate grouping.</p>' ] }, { xtype: 'displayfield', fieldLabel: 'Selected State', bind: '{states.value}' }, { xtype: 'combobox', reference: 'states', publishes: 'value', fieldLabel: 'Select State', displayField: 'state', anchor: '-15', store: { type: 'remote-states', autoLoad: true }, minChars: 0, queryMode: 'local', tpl: [ '<ul class="x-list-plain">', '<tpl for=".">', '<li class="', Ext.baseCSSPrefix, 'grid-group-hd ', Ext.baseCSSPrefix, 'grid-group-title">{abbr}</li>', '<li class="x-boundlist-item">', '{state}, {description}', '</li>', '</tpl>', '</ul>' ] }] }]});
model
Ext.define('KitchenSink.model.State', { extend: 'KitchenSink.model.Base', fields: [ 'abbr', 'state', 'description', 'country' ]});
store
Ext.define('KitchenSink.store.RemoteStates', { extend: 'Ext.data.Store', alias: 'store.remote-states', model: 'KitchenSink.model.State', storeId: 'remote-states', proxy: { type: 'ajax', url: 'resources/data/form/states_remote.php', reader: { type: 'array', rootProperty: 'data' } }});
0 0
- Ext.js5(自定义的下拉列表模板)(从服务器加载数据)(28)
- Ext.js5(加载本地数据)(自定义模板完成自定义UI)(29)
- Ext.js5用XML数据做的表(12)
- Ext.js5的面板(2)
- Ext.js5的数组表格(3)
- Ext.js5的分组表格(4)
- Ext.js5的列冻结(5)
- Ext.js5(关联数据插件)(SubTable)(23)
- Ext.js5下拉框—简单下拉框(publishes)(26)
- Ext.js5带子标题的标题的表格(6)
- Ext.js5的表格的排序扩展(7)
- Ext.js5的带分页的表格(10)
- Ext.js5的小部件表格(23)
- Ext.js5表单的文件上传(toast)(30)
- 搜索过的问题集合(主要是Ext.js5)
- Ext.js5表单—即时查询(结合Ext.Template和远程数据)(52)
- Ext的异步请求(二级级联动态加载下拉列表)
- Ext.js5表单—(自定义错误信息)(formBind)(53)
- 心血来潮拆华硕X54H笔记本(打算升级)
- WebKit之IDL关键字汇总整理
- 您能看出这个Double Check里的问题吗?(解答)
- android 判断 手机号码、邮编、Email邮箱、是否正确
- java开发俄罗斯方块学习笔记 Day-6 布局
- Ext.js5(自定义的下拉列表模板)(从服务器加载数据)(28)
- MySQL学习——MySQL安装
- Linux 文件相关的常用命令
- 我犯了一个错误,您能指出吗?
- OSGI系列 Restful发布服务
- 阿里云云盾占用过多内存
- 博客展示如何自动换行
- poj 2718 Smallest Difference 【STL + dfs】
- 我犯了一个错误,您能指出吗?(结论)