PDA

View Full Version : Help on XMLDataModel



khanh3m
25 Oct 2006, 10:47 AM
Hi,
I have an XML file that looks like this:

<xml>
<viewentries>
<viewentry>
<entrydata>
<text></text>
</entrydata>
<entrydata>
<textlist>
<text>535 5th ave</text>
<text>--Opportunity--</text>
<text>xxx.</text>
<text>IA, 54545</text>
</textlist>
</entrydata>
<entrydata>
<textlist>
<text>kris n</text>
<text>Phone: xxx-xxx-xxxxx</text>
<text>kn@myemal.com</text>
</textlist>
</entrydata>
<entrydata>
<text>blahblahblahblah</text>
</entrydata>
</viewentry>
</viewentries>

I tried to use the XMLDataModel for my grid. However, I have a hard time understanding on how to create a schema that can loop through the text list under the <entrydata> node. Can anyone in here help me get this going? Thanks

jack.slocum
25 Oct 2006, 4:19 PM
You'd need to override the loadData() method and provide your own XML node loading. There's no way to handle that data generically.

If you look at the existing loadData method, you will see it's not very difficult to work with.

khanh3m
25 Oct 2006, 8:54 PM
Thanks for your response.
I'm very new at this stuff...I just want to learn more about it. I'm very appreciated if you could give me an example on how to override this loaddata method? Thanks

KN

jack.slocum
26 Oct 2006, 7:47 AM
The example is the existing loadData() method. To override:



myDataModel.loadData = function(...){
.... your loading code
};