Ext XmlReader 得不到数据

mominghuan 2009-11-10 03:39:43
我是用google app engine 来测试的。

可是怎么也载入不到xml的数据。 请各位帮忙看看~~~!

test.js




systemformPanel = Ext.extend(Ext.form.FormPanel,{

_record : new Ext.data.Record.create(["name" , "address" ,"email","phone"]),

_store : new Ext.data.Store({
autoLoad:true,
url:"http://localhost:8080/xml",
reader:new Ext.data.XmlReader({record:"person"} ,this._record)
}),

constructor:function(){

systemformPanel.superclass.constructor.call(this, {

renderTo:Ext.getBody(),
frame:true,
width:692,
height:165,
bodyStyle:'padding:5px',
monitorValid:true,
layout:'form',
labelWidth:60,
title:'XmlReader Test',
labelAlign:'right',
store:this._store,
items:[{
xtype:'panel',
layout:'column',
fieldLabel:'Name',
isFormField:true,
items:[{//第一行

columsWidth:.5,
xtype:'textfield',
dataIndex:"name",
allowBlank:false,
blankText:'pls input',
width:230,
name:'name',
anchor:'90%',
},{

columnWidth:.999,
layout:'form',
labelWidth:78,
labelAlign:'right',
items:[{

xtype:'textfield',
fieldLabel:'Address',
dataIndex:"address",
allowBlank:false,
name:'address',
anchor:'95%'
}]
}]
},{//第二行
xtype:'panel',
layout:'column',
fieldLabel:'Email',
isFormField:true,
items:[{

columnWidth:.370,
xtype:'textfield',
dataIndex:"email",
allowBlank:false,
vtype:'email',
vtypeText:'格式错误~!',
name:'email',
anchor:'90%'
},{

columnWidth:.633,
layout:'form',
labelWidth:78,
items:[{

xtype:'textfield',
dataIndex:"phone",
name:'phone',
allowBlank:false,
fieldLabel:'Phone',
anchor:'95%'
}]
}]

},{//第三行


}],
buttons:[{

text:'OK',
handler:this.onSubmitClick,
scope:this,
}]

});
//this._store.load();
},
onSubmitClick:function(){
alert(this._store.getCount());
},
setValues:function(){

},
});



http://localhost:8080/xml 请求的xml文件如下:

<?xml version="1.0" encoding="UTF-8"?>
<dataset>
<person>
<name>abcd</name>
<address>abcd</address>
<email>abcd@163.com</email>
<phone>1234567</phone>
</person>
</dataset>


html文件如下:

<link rel="stylesheet" type="text/css" href="/js/ext/resources/css/ext-all.css" />
<script type="text/javascript" src="/js/ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="/js/ext/ext-all.js"></script>
<script type="text/javascript" src="/js/test.js" ></script>

<script type="text/javascript">
Ext.onReady(function(){
var _formPanel = new systemformPanel();
});

</script>

...全文
149 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

87,993

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧