[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中的数据呀