当前位置:编程学习 > C#/ASP.NET >>

用extjs的jsonStore时碰到的问题,求解答

在用extjs的jsonStore时碰到的问题,没法往comboBox绑定,请高手指点

还有如果用url请求后台取数据时,根本不去请求后台文件,报的错误跟上面是一样的。
url: 'TestExtJs.ashx',

代码:
 Ext.onReady(function () {
            var store = new Ext.data.JsonStore({
                data: { 'results': 2, 'rows': [
                        { 'id': 1, 'name': 'Bill' },
                        { 'id': 2, 'name': 'Ben' }
                        ]
                },
                autoLoad: true,
                root: 'rows',
                fields: ['id', 'name']
            });

            var form = new Ext.form.FormPanel({
                title: 'test',
                frame: true,
                id: 'frTest',
                width: 300,
                autoHeight: true,
                items: [
                    {
                        fieldLabel: '姓名',
                        xtype: 'combo',
                        id: 'comboName',
                        store: store
                    }
                ],
                renderTo: Ext.getBody()
            });
        });

错误描述:


comboBox一直Loading...不显示数据
Ext JS ComboBox 异步 --------------------编程问答-------------------- 先顶起,求解 --------------------编程问答--------------------
引用 楼主 l630337237 的回复:
在用extjs的jsonStore时碰到的问题,没法往comboBox绑定,请高手指点

还有如果用url请求后台取数据时,根本不去请求后台文件,报的错误跟上面是一样的。
url: 'TestExtJs.ashx',

代码:
 Ext.onReady(function () {
            var store = new Ext.data.JsonStore({
                data: { 'results': 2, 'rows': [
                        { 'id': 1, 'name': 'Bill' },
                        { 'id': 2, 'name': 'Ben' }
                        ]
                },
                autoLoad: true,
                root: 'rows',
                fields: ['id', 'name']
            });

            var form = new Ext.form.FormPanel({
                title: 'test',
                frame: true,
                id: 'frTest',
                width: 300,
                autoHeight: true,
                items: [
                    {
                        fieldLabel: '姓名',
                        xtype: 'combo',
                        id: 'comboName',
                        store: store
                    }
                ],
                renderTo: Ext.getBody()
            });
        });

错误描述:


comboBox一直Loading...不显示数据

这是付费的组件,去它的网站去问
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,