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

Re: Can DataSource take XML DOM via the constructor?

Expand Messages
  • Stuart Grimshaw
    ... class. That s what I did in the end, I extended DataTable and overrode initTable & paginateRows. The grid is already created in the page using client side
    Message 1 of 3 , Mar 29, 2007
    • 0 Attachment
      --- In ydn-javascript@yahoogroups.com, "jennykhan" <jennyhan@...> wrote:
      >
      > Hi Stuart,
      >
      > As of the current release, local XML data is not support for
      > DataSources. Only XML retrieved via XHR is supported. We'll
      > considering adding this feature for a future release, but for now, it
      > would need to be achieved through customizations to the DataSource
      class.

      That's what I did in the end, I extended DataTable and overrode
      initTable & paginateRows.

      The grid is already created in the page using client side XSLT
      (Sarissa) and then populate the various fields in initTable from the
      existing markup:

      Web.Widgets.DataTable.prototype._initTable = function()
      {

      // Set up the table.
      var tables = this._elContainer.getElementsByTagName("table");
      this._elTable = tables[0];

      var heads = this._elTable.getElementsByTagName("thead");
      this._elHead = heads[0];

      var bodies = this._elTable.getElementsByTagName("tbody");
      this._elBody = bodies[0];

      // Set up scrolling
      if(this.scrollable) {
      //TODO: conf height

      YAHOO.util.Dom.addClass(this._elContainer,YAHOO.widget.DataTable.CLASS_SCROLLABLE);

      YAHOO.util.Dom.addClass(this._elBody,YAHOO.widget.DataTable.CLASS_SCROLLABLE);

      YAHOO.util.Dom.addClass(this._elBody,YAHOO.widget.DataTable.CLASS_BODY);
      }
      }

      Works pretty well so far, but if you can see any glaring errors in
      this approach ...
    Your message has been successfully submitted and would be delivered to recipients shortly.