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

Re: [ydn-javascript] Using Datasource for non-table data?

Expand Messages
  • Satyam
    The DataSource component can be used separately, instead of passing it to the DataTable component, you would call the sendRequest method after you do the setup
    Message 1 of 2 , Oct 30, 2007
      The DataSource component can be used separately, instead of passing it to
      the DataTable component, you would call the sendRequest method after you do
      the setup of the DataSource as you would normally do for the DataTable.

      Nevertheless, the DataSource is mostly meant to return a flat array, not a
      hierarchical structure as you have. This means that you would have to catch
      events or redefine overridable methods to pick the extra data. Your program
      would become quite convoluted, not a good thing.

      The plain Connection Manager returns you the responseXML object with all the
      DOM methods to travel through it. In the end, it might be easier to just
      use that.

      Satyam

      ----- Original Message -----
      From: "frank.ekern" <frank@...>
      To: <ydn-javascript@yahoogroups.com>
      Sent: Tuesday, October 30, 2007 9:52 AM
      Subject: [ydn-javascript] Using Datasource for non-table data?


      > Hi
      >
      > Is it possible to use the Datasource class for non table data?
      > I am aware that the documentation and featureset for Datasource
      > probably will be extended in the future. Currently it seems to be
      > designed to be used with the Datatable.
      >
      > Simple usage
      > I have a webpage with a few status fields as well as a list of items
      > in a Datatable. The data is in XML and is conceptually similar to the
      > following:
      > <measurements city="Oslo" location="Holmenkollen">
      > <measurement time="12.00" temperature="12" humidity="67" />
      > <measurement time="11.00" temperature="10" humidity="69" />
      > <measurement time="10.00" temperature="9" humidity="75" />
      > <measurement time="09.00" temperature="6" humidity="80" />
      > </measurements>
      >
      > I want to be able to easily obtain the additional information
      > (city/location) as well as the list data by using Datasource. Can this
      > be done by using the correct oConfigs object (which have have not
      > found any documentation for) which parses both the list and the
      > additional data into an object structure, or do I have to hack this
      > manually using either doBeforeParseData or doBeforeCallback?
      >
      > Complex usage:
      > Our web application is also using treeview to present data to the
      > user. Can datasource be used for parsing data in a treestructure as well?
      > For instance:
      > <sites>
      > <country name="Norway">
      > <city name="Oslo">
      > <location name="Holmenkollen">
      > <location name="Grefsen>
      > </city>
      > <city name="Trondheim">
      > <location name="NTH">
      > </city>
      > </country>
      > <country name="Denmark">
      > <city name="Copenhagen">
      > <location name="Tivoli">
      > </city>
      > </country>
      > </sites>
      >
      >
      >
      > BR
      > --
      > Frank Ekern
      >
      >
      >
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      > --
      > No virus found in this incoming message.
      > Checked by AVG Free Edition.
      > Version: 7.5.503 / Virus Database: 269.15.12/1098 - Release Date:
      > 29/10/2007 9:28
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.