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

Re: Loading Datatable with Javascript Var Data

Expand Messages
  • hm_paul
    This does not appear to work. It would seem strange that there is not an easy way to do this. Why force all data to be received on the fly? Looking closer at
    Message 1 of 3 , Mar 28 5:43 AM
    • 0 Attachment
      This does not appear to work. It would seem strange that there is not
      an easy way to do this. Why force all data to be received on the fly?
      Looking closer at the DataSource.js file, it appears as if the data
      can be cached and used again later, so maybe there won't be multiple
      hits to the server for the data.

      --- In ydn-javascript@yahoogroups.com, "Satyam" <satyam@...> wrote:
      >
      > If you look at the constructor of the DataSource object (line 35:
      YAHOO.util.DataSource = function(oLiveData, oConfigs)) you see that it
      sets the this.dataType member variable to the input type according to
      the parameter given to the constructor. This is a different member
      variable than responseType, which is the one you set and that would
      indicate DataSource what is the nature of the data should it come over
      a connection. Try setting dataType instead of responseType.
      Nevertheless, I haven't tried and it might still be unable to parse
      XML already in the page.
      >
      > Satyam
      >
      >
      > ----- Original Message -----
      > From: hm_paul
      > To: ydn-javascript@yahoogroups.com
      > Sent: Tuesday, March 27, 2007 4:00 PM
      > Subject: [ydn-javascript] Loading Datatable with Javascript Var Data
      >
      >
      > Is there an obvious way to load a DataTable with data that was
      > previously downloaded? For example, if I already have a bunch of XML
      > stored off in a var in my script and just want to display it in a
      > DataTable, how would I do this?
      >
      > i.e.,
      > --------
      > var theXml = someJsFunctionThatGetsXml();
      >
      > var myColumnSet = new YAHOO.widget.ColumnSet(myColumnHeaders);
      > var myDataSource = new YAHOO.util.DataSource(theXml);
      > myDataSource.responseType = YAHOO.util.DataSource.TYPE_XML;
      > --------
      >
      > This doesn't seem to produce the intended result, whereas if instead
      > of specifying "theXml" as a parameter to the DataSource constructor, I
      > specify a URL that returns XML, it works fine.
      >
      > My reason for wanting to do this is probably obvious -- I'm changing
      > the DataTable often and want to do it client-side instead of having to
      > make numerous server-side calls.
      >
      > Thanks in advance for any help.
      >
      >
      >
      >
      >
      >
      >
      ------------------------------------------------------------------------------
      >
      >
      > No virus found in this incoming message.
      > Checked by AVG Free Edition.
      > Version: 7.5.446 / Virus Database: 268.18.18/734 - Release Date:
      26/03/2007 14:31
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.