Ext 下拉框联动第一次显示不正常的问题
做下拉框联动,异步加载数据,第一次显示时数据不准确,不要在combo_2的下拉框直接绑定store,在combo_1的改变事件里调用下面的方法
function GetAllCustomerBrand(customerID) {
var storeCustomerBrand = Ext.StoreManager.lookup("customerBrandStoreCombo");
if (!storeCustomerBrand) {//第一次加载
storeCustomerBrand = Ext.create("Ext.data.Store", {
storeId: "customerBrandStoreCombo",
fields: ["BrandID", "BrandName", "ApplyUserID"],
proxy: {
url: "url",
type: "ajax",
extraParams: { "customerID": customerID
},
listeners: {
"load": function (store, records, opts) {
store.add({ "BrandName": "新建品牌...", "BrandID": 1, "ApplyUserID": null });
}
}
});
Ext.getCmp("combo_2").bindStore(storeCustomerBrand);//首次加载 combo_2绑定此store
}
else {
storeCustomerBrand.load({ params: { "customerID": customerID } });
}
}
Ext 下拉框联动第一次显示不正常的问题的更多相关文章
- Java Swing应用程序 JComboBox下拉框联动查询
在web项目中,通过下拉框.JQuery和ajax可以实现下拉框联动查询. 譬如说,当你查询某个地方时,页面上有:省份:<下拉框省份> 市区:<下拉框市区> 县乡:<下拉 ...
- C# 生成月份及天选择列表,方便做下拉框联动
月份及天选择列表,很方便做下拉框联动 /// <summary> /// 获取月份选择列表(根据当前语言环境显示月份名称) /// </summary> private IEn ...
- Ajax jQuery下拉框联动案例
需求: 使用ajax和jQuery实现下拉框联动. 注意:需要加入jquery-2.1.1.min.js 前台 <!DOCTYPE html> <html> <head& ...
- SSM框架,在Html界面利用ajax,json,jQuery实现省市区下拉框联动
1.先生成省市区表格 2.建立实体类 3.在html画出下拉框 <select id="province"> <option value="" ...
- jQuery Ajax MVC 下拉框联动
无刷新下拉框联动方法: Controllers代码 public JsonResult DH_Change(string DH_ID) { List<SelectListItem> Tea ...
- 让下拉框中同时显示Key与Value
声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...
- html年月日下拉联动菜单 年月日三下拉框联动
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- 月薪10K必备--C#下拉框联动
下拉框联动 很多网站上都用到下拉框联动,就是第一个下拉框没有选择任何项,第二个下拉框就没有选项.这样的做法更加谨慎,更加紧密. 下面我就教大家怎么做下拉框联动: 首先在窗 ...
- 基于bootstrap-multiselect.js的下拉框联动
背景:当option特别多时,一般的下拉框选择起来就有点力不从心了,所以使用multiselect是个很好的选择,可以通过输入文字来选择选项很方便,但是有一个需要下拉框联动,网上找了半天才找到解决方法 ...
随机推荐
- emguCv3.x 实现字符分割,轮廓检测
/// <summary> /// 获取区域 /// </summary> /// <param name="bitmap"></para ...
- spring Bean的三种注入方式
1.构造函数注入: 构造函数的注入方式分为很多种 (1)普通构造函数,空参数的构造函数 <bean id="exampleBean" class="examples ...
- html 页面太长滚动时,固定页面菜单标签,或者导航标签的位置,fixed/stickUp the position
有时你曾经需要把页面上的某些东西当页面太长发滚动的时候保留置顶位置显示,或许你有别的实现方式,我这个仅供参考, 源代码: /*global $, jQuery, alert*/ (function ( ...
- python报错Could not open PYTHONSTARTUP
root@liqian-python:/pythonShare/monitor/m_server/core# pythonPython 2.7.10 (default, Oct 14 2015, 16 ...
- PLSQL 几种游标的用法
分类: Oracle 1. PL/SQL里的游标可以分为显式和隐式两种,而隐式有分为select into隐式游标和for .. in 隐式游标两种.所以,我们可以认为,有3种游标用法: A. 显式游 ...
- javascript screen对象
1.screen对象用于获取用户的屏幕信息 2. window.screen.属性 3.对象属性
- 从头开始学Java【1】
1:常见的DOS命令 盘符的切换 d:回车 目录的进入 cd javase cd javase\day01\code 目录的回退 cd.. cd\ 清屏 cls 退出 exit 创建目录 md 删除目 ...
- POJ 2656 Unhappy Jinjin
#include <stdio.h> int main() { ) { int i, n; ; scanf("%d", &n); ) break; ; i &l ...
- 5-jQuery - AJAX get()/post()页面请求即执行
get 前台页面 <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> &l ...
- 在 Sublime Text 3 中快捷打开 git-gui
在文件夹右键菜单上可以方便的打开 git-gui,在 st 里面也可以添加这个右键菜单. 步骤如下: 安装 SideBarEnhancements 插件. 在 SideBarEnhancements ...