Results 1 to 3 of 3

Thread: Getting an XML node automatically in Xtemplate

  1. #1
    Sencha User
    Join Date
    Oct 2007
    Posts
    22

    Default Getting an XML node automatically in Xtemplate

    Hi,

    I am wondering if it is possible to get the nodevalue from a XML document in a Xtemplate without defining it in the Ext.data.Record class first?
    I've read that one can extend the template with member functions, but I don't know how I can get a reference to the XML-document being parsed?

    So, for your information I've defined an Ext.data.Record, an Ext.data.XMLreader, a store, and a Rowexpander grid.

    Suppose I have this xml:
    <records>
    <record>
    <projectname>blah 1</projectname>
    <link>http://localhost/blah1</link>
    <members>
    <member><name>member1</name><link>http://localhost/member1</link></member>
    <member><name>member2</name><link>http://localhost/member2</link></member>
    </members>
    </record>
    </records>

    Now I've defined the Record object as:
    var record = Ext.data.Record.create([
    {name: 'projectname'},
    {name: 'membername', mapping: 'members/member/name'}
    ]
    );

    Now what I want is to automatically get the nodevalue of the node "link" without defining it first in the Record-object.
    Can that be done by any means?

    Thanks in advance.

  2. #2
    Sencha User
    Join Date
    Oct 2007
    Posts
    22

    Default

    Hm, I am currently still searching for a solution, is there anybody who can help?

  3. #3
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    You need the data somewhere in your record and the 2 fields you defined now don't contain this data. So the only option is to add a field.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •