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

Why am I getting this event error??

Expand Messages
  • j2ee20072007
    Does anyone know why the line this.fireEvent( tableMsgShowEvent , {html:sHTML, className:sClassName}); might be giving the error Property does not support
    Message 1 of 2 , Nov 1, 2007
    • 0 Attachment
      Does anyone know why the line "this.fireEvent("tableMsgShowEvent",
      {html:sHTML, className:sClassName});" might be giving the
      error "Property does not support this method"? From what I can tell
      this is just trying to set up a very basic datatable. This worked
      under 2.2.2:


      YAHOO.widget.DataTable.prototype.showTableMessage = function(sHTML,
      sClassName) {
      var elCell = this._elMsgTd;
      if(YAHOO.lang.isString(sHTML)) {
      elCell.innerHTML = sHTML;
      }
      if(YAHOO.lang.isString(sClassName)) {
      YAHOO.util.Dom.addClass(elCell, sClassName);
      }
      this._elMsgTbody.style.display = "";
      this.fireEvent("tableMsgShowEvent", {html:sHTML,
      className:sClassName});
      };

      Here's the code:


      // Override the built-in link formatter
      YAHOO.widget.Column.formatLink = function(elCell, oRecord, oColumn,
      oData) {
      var batchId = oData;
      elCell.innerHTML = "<a href=\"BatchDetail.do?batchId=" + batchId
      + "\">" + batchId + "</a>";
      };


      var columnHeaders = [
      {key:"batchNumber", text:"<br>Batch Number", type:"link"},
      {key:"dateProduced", text:"Date Produced", type:"Date"},
      {key:"datePrinted", text:"Date Printed", type:"Date"},
      {key:"dateMailed",
      text:"Date Mailed",
      type:"text",
      editor:"textbox"},
      {key:"Count", text:" Count", type:"Number"}
      ];

      var columnSet = new YAHOO.widget.ColumnSet(columnHeaders);

      <%= request.getAttribute("javascriptArrayData") %>

      var dataSource = new YAHOO.util.DataSource(batchData);

      dataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;

      dataSource.responseSchema = {
      fields:
      ["batchNumber","dateProduced","datePrinted","dateMailed","Count"]
      };

      var dataTable = new YAHOO.widget.DataTable("editing", columnHeaders,
      dataSource
      ); // This line produces the event error


      Thanks
    • Satyam
      type is no longer a property in 2.3. You would have to say: ... , formatter: link , ... and ..., formatter: date , .. and make Date and Number lowercase, as
      Message 2 of 2 , Nov 1, 2007
      • 0 Attachment
        type is no longer a property in 2.3. You would have to say:

        ... , formatter: 'link', ...

        and

        ..., formatter:'date' , ..

        and make Date and Number lowercase, as above


        ----- Original Message -----
        From: "j2ee20072007" <j2ee20072007@...>
        To: <ydn-javascript@yahoogroups.com>
        Sent: Thursday, November 01, 2007 3:34 PM
        Subject: [ydn-javascript] Why am I getting this event error??


        > Does anyone know why the line "this.fireEvent("tableMsgShowEvent",
        > {html:sHTML, className:sClassName});" might be giving the
        > error "Property does not support this method"? From what I can tell
        > this is just trying to set up a very basic datatable. This worked
        > under 2.2.2:
        >
        >
        > YAHOO.widget.DataTable.prototype.showTableMessage = function(sHTML,
        > sClassName) {
        > var elCell = this._elMsgTd;
        > if(YAHOO.lang.isString(sHTML)) {
        > elCell.innerHTML = sHTML;
        > }
        > if(YAHOO.lang.isString(sClassName)) {
        > YAHOO.util.Dom.addClass(elCell, sClassName);
        > }
        > this._elMsgTbody.style.display = "";
        > this.fireEvent("tableMsgShowEvent", {html:sHTML,
        > className:sClassName});
        > };
        >
        > Here's the code:
        >
        >
        > // Override the built-in link formatter
        > YAHOO.widget.Column.formatLink = function(elCell, oRecord, oColumn,
        > oData) {
        > var batchId = oData;
        > elCell.innerHTML = "<a href=\"BatchDetail.do?batchId=" + batchId
        > + "\">" + batchId + "</a>";
        > };
        >
        >
        > var columnHeaders = [
        > {key:"batchNumber", text:"<br>Batch Number", type:"link"},
        > {key:"dateProduced", text:"Date Produced", type:"Date"},
        > {key:"datePrinted", text:"Date Printed", type:"Date"},
        > {key:"dateMailed",
        > text:"Date Mailed",
        > type:"text",
        > editor:"textbox"},
        > {key:"Count", text:" Count", type:"Number"}
        > ];
        >
        > var columnSet = new YAHOO.widget.ColumnSet(columnHeaders);
        >
        > <%= request.getAttribute("javascriptArrayData") %>
        >
        > var dataSource = new YAHOO.util.DataSource(batchData);
        >
        > dataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
        >
        > dataSource.responseSchema = {
        > fields:
        > ["batchNumber","dateProduced","datePrinted","dateMailed","Count"]
        > };
        >
        > var dataTable = new YAHOO.widget.DataTable("editing", columnHeaders,
        > dataSource
        > ); // This line produces the event error
        >
        >
        > Thanks
        >
        >
        >
        >
        >
        > Yahoo! Groups Links
        >
        >
        >
        >
        >
        > --
        > No virus found in this incoming message.
        > Checked by AVG Free Edition.
        > Version: 7.5.503 / Virus Database: 269.15.17/1103 - Release Date:
        > 01/11/2007 6:01
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.