Home  >  Article  >  Web Front-end  >  Code for ext to read xml of two structures_YUI.Ext related

Code for ext to read xml of two structures_YUI.Ext related

WBOY
WBOYOriginal
2016-05-16 18:59:02981browse



Software 1
1.gif


Control 2
2.gif


This is more common and many examples on the Internet are like this Format, I will also write the main code
var Info= Ext.data.Record.create([
'name', 'icon''
]);
reader=new Ext.data. XmlReader({
record: 'software',
id: 'name'
}, Info);
The following is another format of xml





Main code for reading
var Info= Ext.data.Record.create([
{name: 'name ', mapping: '@name'},
{name: 'icon', mapping: '@icon' }
]);
reader=new Ext.data.XmlReader({
record : 'software',
id: 'name'
}, Info);
ext's help document only has the first way of writing it, and it took me almost two hours to find the second way. The method, I don’t know the reason yet, but it works. I hope an expert can explain it to me. I'm all ears!
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn