问题描述
用extjs+json时出错,grid怎么也不显示数据,为什么?帮忙看看,谢谢,急死了functionset_grid(){varstore=newExt.data.Store({proxy:newExt.data.HttpProxy({url:'BookData.ashx'}),reader:newExt.data.JsonReader({root:'bookinfo',totalProperty:'count',fields:[{name:'bid'},{name:'name'},{name:'author'}]}),remoteSort:true});varnm=newExt.grid.RowNumberer();varcol=newExt.grid.ColumnModel([nm,{header:"图书编号",dataIndex:"bid",sortable:true},{header:"图书名称",dataIndex:"name",sortable:true},{header:"图书作者",dataIndex:"author",sortable:true}]);vargrid=newExt.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":"KennethH.Rosen"}]}
解决方案
解决方案二:
解决方案三:
grid.render(document.body);//grid不会冲突吧?或加入到某个extwindow中
解决方案四:
引用2楼jyk1970的回复:
grid.render(document.body);//grid不会冲突吧?或加入到某个extwindow中
不是那的问题,grid都显示出了,只是没数据
解决方案五:
不知道帮顶
解决方案六:
up
解决方案七:
在代码最后加上ds.load({params:{start:0,limit:5}});