Loading ...
Sorry, an error occurred while loading the content.

Re: DataSource Models

Expand Messages
  • jennykhan
    Hi there, If you need to parse complex nested data as you describe below, at this time your best bet is to customize the DataSource method parseXMLData . And
    Message 1 of 2 , Aug 1, 2007
    • 0 Attachment
      Hi there,

      If you need to parse complex nested data as you describe below, at
      this time your best bet is to customize the DataSource method
      "parseXMLData".

      And yes, as of the 2.3.0 release, DataSource indeed has a new property
      "connMethodPost" to support XHR requests with POST. Check out the
      example here to see it in action:
      http://developer.yahoo.com/yui/examples/datatable/dt_xhrpostxml.html

      Hope that helps,
      Jenny



      --- In ydn-javascript@yahoogroups.com, "monsieurdizzy" <ewalklet@...>
      wrote:
      >
      > Hello, everyone.
      >
      > I've been using YUI's DataSource class as a manager for multiple AJAX
      > requests in a web environment to which I am contributing. There isn't
      > much documentation on this particular corner of the YUI world, but
      > this post proved very helpful:
      >
      > http://tech.groups.yahoo.com/group/ydn-javascript/message/14270
      >
      > My question is with regards to the "model" parameter when sending a
      > request. The "model" defines which fields to retrieve from the XML
      > response. Up until recently, my XML response has been single-leveled,
      > so all I've needed was the name of the root node and an array of the
      > various element names.
      >
      > Now, however, the rest of the development team has switched to XML
      > responses with various layers of nesting, and the example posted
      > earlier gives no such example of this.
      >
      > Does YUI DataSource support response models with nested elements? If
      > so, what would the model look like if I was processing an XML
      > structure like this?
      >
      > <xmlresponse>
      > <fruits>
      > <red>apple</red>
      > <red>cherry</red>
      > <green>watermelon</green>
      > <green>lime</green>
      > </fruits>
      > <vegetables>
      > <orange>carrot</orange>
      > <orange>pumpkin</orange>
      > <purple>eggplant</purple>
      > <purple>monkey</purple>
      > </vegetables>
      > </xmlresponse>
      >
      > As an aside, I know DataTable was given a significant revamp, but were
      > any of the other additions that were mentioned on this forum included
      > in DataSource as intended, such as the ability to make POST requests?
      >
      > Thank you very much for your time and consideration.
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.