haha662 2010-08-13 09:44
浏览 331
已采纳

Ext grid 读不出xml的数据

[code="html"]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



无标题文档
Ext.onReady(function(){ Ext.BLANK_IMAGE_URL = '../extjs/resources/images/default/s.gif'; var dataStore = new Ext.data.Store({ proxy:new Ext.data.HttpProxy({url:'sampledata-sheldon.xml'}), reader:new Ext.data.XmlReader({ record:'Item', id:'ASIN' },['Author', 'Title', 'Manufacturer', 'ProductGroup']) }); dataStore.load(); var colModel = new Ext.grid.ColumnModel([ {header: "Author", width: 120, dataIndex: 'Author'}, {header: "Title", width: 180, dataIndex: 'Title'}, {header: "Manufacturer", width: 115, dataIndex: 'Manufacturer'}, {header: "Product Group", width: 100, dataIndex: 'ProductGroup'} ]); var grid = new Ext.grid.GridPanel({el:'grid',ds:dataStore,cm:colModel}); grid.render(); });




[/code]

sampledata-sheldon.xml
[code="xml"]
<?xml version="1.0" encoding="gb2312"?>


0446613657

http://www.amazon[*SNIP*]JVQEG2


Sidney Sheldon
Warner Books
Book
Are You Afraid of the Dark?

[/code]
只显示了以行表头而已,其他没显示了,请问怎么才能显示出xml中的数据呀

  • 写回答

11条回答 默认 最新

  • 「已注销」 2010-08-13 09:51
    关注

    这有个使用xml作为数据源的例子,很详细,也是grid的,你看看就明白了!
    [url]http://java2000-net.iteye.com/blog/241968[/url]

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(10条)

报告相同问题?

悬赏问题

  • ¥15 seatunnel-web使用SQL组件时候后台报错,无法找到表格
  • ¥15 fpga自动售货机数码管(相关搜索:数字时钟)
  • ¥15 用前端向数据库插入数据,通过debug发现数据能走到后端,但是放行之后就会提示错误
  • ¥30 3天&7天&&15天&销量如何统计同一行
  • ¥30 帮我写一段可以读取LD2450数据并计算距离的Arduino代码
  • ¥15 飞机曲面部件如机翼,壁板等具体的孔位模型
  • ¥15 vs2019中数据导出问题
  • ¥20 云服务Linux系统TCP-MSS值修改?
  • ¥20 关于#单片机#的问题:项目:使用模拟iic与ov2640通讯环境:F407问题:读取的ID号总是0xff,自己调了调发现在读从机数据时,SDA线上并未有信号变化(语言-c语言)
  • ¥20 怎么在stm32门禁成品上增加查询记录功能