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

Extjs做Grid时的问题?

用extjs+json时出错,grid怎么也不显示数据,为什么?帮忙看看,谢谢,急死了

function set_grid(){
    var store=new Ext.data.Store({
            proxy : new Ext.data.HttpProxy( {url:'BookData.ashx'} ),
            reader: new Ext.data.JsonReader({
            root: 'bookinfo',
            totalProperty: 'count',
            fields: [{name:'bid'},{name:'name'},{name:'author'}]
        }),
            remoteSort:true
        });
        
        
    var nm = new Ext.grid.RowNumberer();
    var col=new Ext.grid.ColumnModel([nm,
        {header:"图书编号",dataIndex:"bid",sortable:true},
        {header:"图书名称",dataIndex:"name",sortable:true},
        {header:"图书作者",dataIndex:"author",sortable:true}  
    ]);
    var grid=new Ext.grid.GridPanel({
        frame:true,
        collapsible: true,
        animCollapse: false,
        iconCls: 'icon-grid',
        renderTo:"data",
        title:"网上书店",
        loadMask: {msg:'正在加载数据,请稍侯……'},
        height:400,
        width:600,
        trackMouseOver:true,
        cm:col,
        store:store,
        autoExpandColumn:2
    });
}


{"count":"5","bookinfo":[{"Bid":1,"Name":"c#入门经典","Author":"不认识"},{"Bid":2,"Name":"正则表达式","Author":"Jerff"},{"Bid":3,"Name":"明朝那些事儿","Author":"当年明月"},{"Bid":4,"Name":"大话设计模式","Author":"程杰"},{"Bid":5,"Name":"离散数学及应用","Author":"Kenneth H.Rosen"}]} --------------------编程问答-------------------- 此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
楼主【qq562342】截止到2008-07-07 22:02:03的历史汇总数据(不包括此帖):
发帖的总数量:73                       发帖的总分数:1946                     
结贴的总数量:48                       结贴的总分数:1256                     
无满意结贴数:5                        无满意结贴分:141                      
未结的帖子数:25                       未结的总分数:690                      
结贴的百分比:65.75 %               结分的百分比:64.54 %                  
无满意结贴率:10.42 %               无满意结分率:11.23 %                  
楼主加油 --------------------编程问答-------------------- grid.render(document.body); //grid 不会冲突吧?

加入到某个ext window中 --------------------编程问答--------------------
引用 2 楼 jyk1970 的回复:
grid.render(document.body); //grid 不会冲突吧?

加入到某个ext window中


不是那的问题,grid都显示出了,只是没数据 --------------------编程问答-------------------- 不知道
帮顶 --------------------编程问答-------------------- up --------------------编程问答-------------------- 在代码最后加上
 ds.load({
params : {
start : 0,
limit : 5
}
});
补充:.NET技术 ,  ASP.NET
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,