惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cisco Talos Blog
Cisco Talos Blog
量子位
小众软件
小众软件
Microsoft Azure Blog
Microsoft Azure Blog
V
Visual Studio Blog
I
InfoQ
Jina AI
Jina AI
The Cloudflare Blog
Recorded Future
Recorded Future
Recent Announcements
Recent Announcements
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
G
Google Developers Blog
Stack Overflow Blog
Stack Overflow Blog
阮一峰的网络日志
阮一峰的网络日志
Microsoft Security Blog
Microsoft Security Blog
美团技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Martin Fowler
Martin Fowler
T
Tailwind CSS Blog
博客园 - Franky
酷 壳 – CoolShell
酷 壳 – CoolShell
F
Fortinet All Blogs
WordPress大学
WordPress大学
P
Proofpoint News Feed
D
DataBreaches.Net
爱范儿
爱范儿
雷峰网
雷峰网
D
Docker
B
Blog
Engineering at Meta
Engineering at Meta
腾讯CDC
N
Netflix TechBlog - Medium
C
Check Point Blog
博客园 - 【当耐特】
Apple Machine Learning Research
Apple Machine Learning Research
T
Tenable Blog
GbyAI
GbyAI
Security Archives - TechRepublic
Security Archives - TechRepublic
博客园 - 三生石上(FineUI控件)
T
The Blog of Author Tim Ferriss
博客园 - 聂微东
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
SecWiki News
SecWiki News
S
Security @ Cisco Blogs
S
Security Affairs
V
V2EX
Application and Cybersecurity Blog
Application and Cybersecurity Blog
云风的 BLOG
云风的 BLOG
C
CERT Recently Published Vulnerability Notes
Y
Y Combinator Blog

博客园 - lwjacky

SQL提高查询效益之in、not in、between、like等条件讲述 sqlserver查询数据的所有表名和行数 Extjs4---Cannot read property 'addCls' of null Sql 脚本文件太大 系统操作日志设计 一种简单的直观的高效的权限设计 ExtJs 常用方法 属性 C#农历类 通过C#使用googleAPI SQL SERVER 如何批量修改表和存储过程的架构 HTML特殊转义字符列表 - lwjacky - 博客园 extjs3.0 修正 ie 与 firefox字体显示差异的补丁 C#实现QQ接口软件--QQ的HTTP接口协议探究 二次开发WinWebMail邮件系统接口 C#实现汉字转换为拼音缩写的代码 C#实现将汉字转化为拼音的代码 extjs IE8下datefield的width问题 ExtJS中如何给Label添加click事件 自己的工具箱(Toolkit)
ExtJs4.1实现数据缓存
lwjacky · 2013-11-06 · via 博客园 - lwjacky

Ext.onReady(function () {

            Ext.define("ProvinceCity", {

                extend: "Ext.data.Model",

                fields: [

                { name: "ProvinceName", type: "string" },

                { name: "CityName", type: "string" }

                ]

            });

            var store = Ext.create("Ext.data.Store", {

                model: "ProvinceCity",

                //autoLoad: true,//进行手动加载

                proxy: {

                    type: "ajax",

                    url: "test2.aspx",

                    reader: {

                        type: "xml",

                        record: "Table"

                    }

                }

            });

            var data;

            var dataStore = new Array();

            store.load({

                scope: this,

                callback: function (records, operation, success) {

                    data = store.collect("ProvinceName"); //因为省份有重复的选项,要把其中重复的选项去掉

                    Ext.Array.each(data, function (item) {

                        dataStore.push({ 'ProvinceName': item });

                    });

                }

            });

            var store1 = Ext.create("Ext.data.Store", {

                fields: ["ProvinceName"],

                data: dataStore,

                proxy: {

                    type: "memory"

                }

            });

            var store2 = Ext.create("Ext.data.Store", {

                model: "ProvinceCity",

                proxy: {

                    type: "memory"

                }

            });

            Ext.create("Ext.form.Panel", {

                id: "form1",

                renderTo: Ext.getBody(),

                bodyPadding: 10,

                width: "auto",

                title: "Please Choose Province And City",

                layout: {

                    type: "hbox",

                    align: "left"

                },

                items: [

                        { xtype: "combobox", id: "provinceName", fieldLabel: "ProvinceName", store: store1, valueField: "ProvinceName", displayField: "ProvinceName", padding: 10, listeners: { "select": function (comboBox, record, index) {

                            var temp = store.queryBy(function (record, id) {

                                if (record.get("ProvinceName") == comboBox.getValue()) {

                                    return true;

                                }

                            });

                            store2.removeAll();

                            store2.add(temp.items);

                            Ext.getCmp("cityName").clearValue();

                            Ext.getCmp("cityName").bindStore(store2);

                        }

                        }

                        },

                        { xtype: "combobox", fieldLabel: "CityName", id: "cityName",  padding: 10, valueField: "ProvinceName", displayField: "CityName"}]

            });

        });