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

DataTable 2.6 and IE

Expand Messages
  • Steaven
    Hi, all. I ve been using DataTable with an XHR based DataSource for quite a while with no problems. I just upgraded to 2.6.0 and am having an issue only with
    Message 1 of 8 , Oct 3, 2008
    • 0 Attachment
      Hi, all.
      I've been using DataTable with an XHR based DataSource for quite a while with no
      problems.
      I just upgraded to 2.6.0 and am having an issue only with (surprise, surprise) IE. Works
      fine in Firefox and Safari. This is with IE 7 and IE 8b2.

      I have narrowed down the problem I think as follows:
      If the underlying XML data has empty nodes, IE wonks out. If it doesn't, IE works.
      For example:
      Say you have 4 fields, A, B, C and D.
      Let's say A, B and C always have data, but D comes over as <D></D> (empty).
      IE wonks out. If you remove D from the DataSource's responseSchema, IE works just fine.
      IE also seems to be having trouble with formatters.

      This may not be the actual cause or underlying reason, but it's the thing that seems to be
      causing it. This wasn't the case in 2.5.X, the same data loaded fine in IE.

      I have tried the old DataSource and the new XHRDataSource constructors, etc no
      difference.

      Anybody have any suggestions?

      Thanks!
    • jennykhan
      Hi Steaven, I m not able to reproduce this problem. Can you post a repro case for debugging? Thanks, Jenny ... while with no ... (surprise, surprise) IE. Works
      Message 2 of 8 , Oct 22, 2008
      • 0 Attachment
        Hi Steaven,

        I'm not able to reproduce this problem. Can you post a repro case
        for debugging?

        Thanks,
        Jenny





        --- In ydn-javascript@yahoogroups.com, "Steaven" <swoyan@...> wrote:
        >
        > Hi, all.
        > I've been using DataTable with an XHR based DataSource for quite a
        while with no
        > problems.
        > I just upgraded to 2.6.0 and am having an issue only with
        (surprise, surprise) IE. Works
        > fine in Firefox and Safari. This is with IE 7 and IE 8b2.
        >
        > I have narrowed down the problem I think as follows:
        > If the underlying XML data has empty nodes, IE wonks out. If it
        doesn't, IE works.
        > For example:
        > Say you have 4 fields, A, B, C and D.
        > Let's say A, B and C always have data, but D comes over as <D></D>
        (empty).
        > IE wonks out. If you remove D from the DataSource's
        responseSchema, IE works just fine.
        > IE also seems to be having trouble with formatters.
        >
        > This may not be the actual cause or underlying reason, but it's
        the thing that seems to be
        > causing it. This wasn't the case in 2.5.X, the same data loaded
        fine in IE.
        >
        > I have tried the old DataSource and the new XHRDataSource
        constructors, etc no
        > difference.
        >
        > Anybody have any suggestions?
        >
        > Thanks!
        >
      • cleavewhitaker
        Hello Jenny, I have also seen the same condition s described above. Below I posted my DataSource initialization snippet.I have also posted the
        Message 3 of 8 , Oct 27, 2008
        • 0 Attachment
          Hello Jenny,

          I have also seen the same condition's described above. Below I posted
          my DataSource initialization snippet.I have also posted the
          oFullResponse.xml data that I pulled from a doBeforeParseData event
          handler which shows the xml that was returned before parsing. In
          particular if you look at the "vendorAccountDescription" xml node you
          will see that it is empty. This is fine, however the value for "code"
          is not and yet it doesn't appear in my datatable either. I have
          noticed that the order of the responseSchema field values seems to
          change which values show up in the datatable, essentially I have
          figured out that any field declaration that is made before {
          key:"vendorAccountDescription" } will not show up in the datatable. I
          am not sure if I just have something incorrectly configured or
          not. Suggestions?

          /* DataSource initialization snippet*/>
          var myColumnDefs =
          [
          { key: "code", label: "Vendor Account Code", sortable: true },
          { key: "vendorNumber", label: "Vendor Number", sortable: true },
          { key: "vendor", label: "Vendor", sortable: false },
          { key: "vendorAccountDescription", label: "Description", sortable:
          false },
          { key: "vendorAccountStatus", label: "Status", sortable: true}
          ];

          var dataConfigs = { connMethodPost: true;};

          var newDataSource = new YAHOO.util.XHRDataSource(XHRSource,
          dataConfigs);

          newDataSource.responseType = YAHOO.util.XHRDataSource.TYPE_XML;
          newDataSource.responseSchema = {
          resultNode: "row",
          fields: [
          { key: "code" },
          { key: "vendorAccountDescription" },
          { key: "vendorAccountGuid" },
          { key: "vendorAccountStatus" },
          { key: "vendorNumber" },
          { key: "vendor" }
          ]
          };

          dataTable = new YAHOO.widget.DataTable("dataTable", myColumnDefs,
          newDataSource, tableConfigs);



          /*oFullResponse.xml from doBeforeParseData*/
          "<response><results>
          <row>
          <vendor>Bell Canada</vendor>
          <vendorNumber>0000359643</vendorNumber>
          <code>12347</code>
          <vendorAccountGuid>84f41857-6f86-49c6-a821-
          b0db8c8699ff</vendorAccountGuid>
          <vendorAccountDescription/>
          <vendorAccountStatus>Active</vendorAccountStatus>
          </row>
          </results></response>"

          --- In ydn-javascript@yahoogroups.com, "jennykhan" <jennyhan@...>
          wrote:
          >
          > Hi Steaven,
          >
          > I'm not able to reproduce this problem. Can you post a repro case
          > for debugging?
          >
          > Thanks,
          > Jenny
          >
          >
          >
          >
          >
          > --- In ydn-javascript@yahoogroups.com, "Steaven" <swoyan@> wrote:
          > >
          > > Hi, all.
          > > I've been using DataTable with an XHR based DataSource for quite
          a
          > while with no
          > > problems.
          > > I just upgraded to 2.6.0 and am having an issue only with
          > (surprise, surprise) IE. Works
          > > fine in Firefox and Safari. This is with IE 7 and IE 8b2.
          > >
          > > I have narrowed down the problem I think as follows:
          > > If the underlying XML data has empty nodes, IE wonks out. If it
          > doesn't, IE works.
          > > For example:
          > > Say you have 4 fields, A, B, C and D.
          > > Let's say A, B and C always have data, but D comes over as
          <D></D>
          > (empty).
          > > IE wonks out. If you remove D from the DataSource's
          > responseSchema, IE works just fine.
          > > IE also seems to be having trouble with formatters.
          > >
          > > This may not be the actual cause or underlying reason, but it's
          > the thing that seems to be
          > > causing it. This wasn't the case in 2.5.X, the same data loaded
          > fine in IE.
          > >
          > > I have tried the old DataSource and the new XHRDataSource
          > constructors, etc no
          > > difference.
          > >
          > > Anybody have any suggestions?
          > >
          > > Thanks!
          > >
          >
        • Satyam
          Don t ask me why but the DataSource goes through the responseSchema.fields backwards so anything before vendorAccountDescription is actually processed after
          Message 4 of 8 , Oct 28, 2008
          • 0 Attachment
            Don't ask me why but the DataSource goes through the
            responseSchema.fields backwards so anything before
            vendorAccountDescription is actually processed after which means it has
            a problem with that field. DataSource uses getElementsByTagName to
            locate elements within the data. I am sure this function behaves
            differently according to the DocType declared for the whole html page
            (there is no two getElementsByTagName in the browser, one for XML,
            another for HTML) and in some flavors using the <tag /> shorthand for
            empty elements is invalid.

            Satyam


            cleavewhitaker wrote:
            > Hello Jenny,
            >
            > I have also seen the same condition's described above. Below I posted
            > my DataSource initialization snippet.I have also posted the
            > oFullResponse.xml data that I pulled from a doBeforeParseData event
            > handler which shows the xml that was returned before parsing. In
            > particular if you look at the "vendorAccountDescription" xml node you
            > will see that it is empty. This is fine, however the value for "code"
            > is not and yet it doesn't appear in my datatable either. I have
            > noticed that the order of the responseSchema field values seems to
            > change which values show up in the datatable, essentially I have
            > figured out that any field declaration that is made before {
            > key:"vendorAccountDescription" } will not show up in the datatable. I
            > am not sure if I just have something incorrectly configured or
            > not. Suggestions?
            >
            > /* DataSource initialization snippet*/>
            > var myColumnDefs =
            > [
            > { key: "code", label: "Vendor Account Code", sortable: true },
            > { key: "vendorNumber", label: "Vendor Number", sortable: true },
            > { key: "vendor", label: "Vendor", sortable: false },
            > { key: "vendorAccountDescription", label: "Description", sortable:
            > false },
            > { key: "vendorAccountStatus", label: "Status", sortable: true}
            > ];
            >
            > var dataConfigs = { connMethodPost: true;};
            >
            > var newDataSource = new YAHOO.util.XHRDataSource(XHRSource,
            > dataConfigs);
            >
            > newDataSource.responseType = YAHOO.util.XHRDataSource.TYPE_XML;
            > newDataSource.responseSchema = {
            > resultNode: "row",
            > fields: [
            > { key: "code" },
            > { key: "vendorAccountDescription" },
            > { key: "vendorAccountGuid" },
            > { key: "vendorAccountStatus" },
            > { key: "vendorNumber" },
            > { key: "vendor" }
            > ]
            > };
            >
            > dataTable = new YAHOO.widget.DataTable("dataTable", myColumnDefs,
            > newDataSource, tableConfigs);
            >
            >
            >
            > /*oFullResponse.xml from doBeforeParseData*/
            > "<response><results>
            > <row>
            > <vendor>Bell Canada</vendor>
            > <vendorNumber>0000359643</vendorNumber>
            > <code>12347</code>
            > <vendorAccountGuid>84f41857-6f86-49c6-a821-
            > b0db8c8699ff</vendorAccountGuid>
            > <vendorAccountDescription/>
            > <vendorAccountStatus>Active</vendorAccountStatus>
            > </row>
            > </results></response>"
            >
            > --- In ydn-javascript@yahoogroups.com, "jennykhan" <jennyhan@...>
            > wrote:
            >
            >> Hi Steaven,
            >>
            >> I'm not able to reproduce this problem. Can you post a repro case
            >> for debugging?
            >>
            >> Thanks,
            >> Jenny
            >>
            >>
            >>
            >>
            >>
            >> --- In ydn-javascript@yahoogroups.com, "Steaven" <swoyan@> wrote:
            >>
            >>> Hi, all.
            >>> I've been using DataTable with an XHR based DataSource for quite
            >>>
            > a
            >
            >> while with no
            >>
            >>> problems.
            >>> I just upgraded to 2.6.0 and am having an issue only with
            >>>
            >> (surprise, surprise) IE. Works
            >>
            >>> fine in Firefox and Safari. This is with IE 7 and IE 8b2.
            >>>
            >>> I have narrowed down the problem I think as follows:
            >>> If the underlying XML data has empty nodes, IE wonks out. If it
            >>>
            >> doesn't, IE works.
            >>
            >>> For example:
            >>> Say you have 4 fields, A, B, C and D.
            >>> Let's say A, B and C always have data, but D comes over as
            >>>
            > <D></D>
            >
            >> (empty).
            >>
            >>> IE wonks out. If you remove D from the DataSource's
            >>>
            >> responseSchema, IE works just fine.
            >>
            >>> IE also seems to be having trouble with formatters.
            >>>
            >>> This may not be the actual cause or underlying reason, but it's
            >>>
            >> the thing that seems to be
            >>
            >>> causing it. This wasn't the case in 2.5.X, the same data loaded
            >>>
            >> fine in IE.
            >>
            >>> I have tried the old DataSource and the new XHRDataSource
            >>>
            >> constructors, etc no
            >>
            >>> difference.
            >>>
            >>> Anybody have any suggestions?
            >>>
            >>> Thanks!
            >>>
            >>>
            >
            >
            >
            > ------------------------------------
            >
            > Yahoo! Groups Links
            >
            >
            >
            > ------------------------------------------------------------------------
            >
            >
            > No virus found in this incoming message.
            > Checked by AVG - http://www.avg.com
            > Version: 8.0.175 / Virus Database: 270.8.4/1749 - Release Date: 27/10/2008 7:57
            >
            >
          • jennykhan
            Hi Cleave, Thanks for the details, but I m still unable to reproduce your problem in FF or IE. In all cases, I see a one row table with the following data:
            Message 5 of 8 , Dec 1, 2008
            • 0 Attachment
              Hi Cleave,

              Thanks for the details, but I'm still unable to reproduce your
              problem in FF or IE. In all cases, I see a one row table with the
              following data:

              Vendor Account Code | Vendor Number | Vendor | Description | Status
              12347 | 0000359643 | Bell Canada | [empty] | Active


              Is that not what you would expect? If you could post a URL to a
              repro case, that might provide some more debugging info....

              Thanks,
              Jenny



              --- In ydn-javascript@yahoogroups.com, "cleavewhitaker"
              <cleaveisme@...> wrote:
              >
              > Hello Jenny,
              >
              > I have also seen the same condition's described above. Below I
              posted
              > my DataSource initialization snippet.I have also posted the
              > oFullResponse.xml data that I pulled from a doBeforeParseData
              event
              > handler which shows the xml that was returned before parsing. In
              > particular if you look at the "vendorAccountDescription" xml node
              you
              > will see that it is empty. This is fine, however the value
              for "code"
              > is not and yet it doesn't appear in my datatable either. I have
              > noticed that the order of the responseSchema field values seems to
              > change which values show up in the datatable, essentially I have
              > figured out that any field declaration that is made before {
              > key:"vendorAccountDescription" } will not show up in the
              datatable. I
              > am not sure if I just have something incorrectly configured or
              > not. Suggestions?
              >
              > /* DataSource initialization snippet*/>
              > var myColumnDefs =
              > [
              > { key: "code", label: "Vendor Account Code", sortable: true },
              > { key: "vendorNumber", label: "Vendor Number", sortable: true },
              > { key: "vendor", label: "Vendor", sortable: false },
              > { key: "vendorAccountDescription", label: "Description",
              sortable:
              > false },
              > { key: "vendorAccountStatus", label: "Status", sortable: true}
              > ];
              >
              > var dataConfigs = { connMethodPost: true;};
              >
              > var newDataSource = new YAHOO.util.XHRDataSource(XHRSource,
              > dataConfigs);
              >
              > newDataSource.responseType = YAHOO.util.XHRDataSource.TYPE_XML;
              > newDataSource.responseSchema = {
              > resultNode: "row",
              > fields: [
              > { key: "code" },
              > { key: "vendorAccountDescription" },
              > { key: "vendorAccountGuid" },
              > { key: "vendorAccountStatus" },
              > { key: "vendorNumber" },
              > { key: "vendor" }
              > ]
              > };
              >
              > dataTable = new YAHOO.widget.DataTable("dataTable", myColumnDefs,
              > newDataSource, tableConfigs);
              >
              >
              >
              > /*oFullResponse.xml from doBeforeParseData*/
              > "<response><results>
              > <row>
              > <vendor>Bell Canada</vendor>
              > <vendorNumber>0000359643</vendorNumber>
              > <code>12347</code>
              > <vendorAccountGuid>84f41857-6f86-49c6-a821-
              > b0db8c8699ff</vendorAccountGuid>
              > <vendorAccountDescription/>
              > <vendorAccountStatus>Active</vendorAccountStatus>
              > </row>
              > </results></response>"
              >
              > --- In ydn-javascript@yahoogroups.com, "jennykhan" <jennyhan@>
              > wrote:
              > >
              > > Hi Steaven,
              > >
              > > I'm not able to reproduce this problem. Can you post a repro
              case
              > > for debugging?
              > >
              > > Thanks,
              > > Jenny
              > >
              > >
              > >
              > >
              > >
              > > --- In ydn-javascript@yahoogroups.com, "Steaven" <swoyan@> wrote:
              > > >
              > > > Hi, all.
              > > > I've been using DataTable with an XHR based DataSource for
              quite
              > a
              > > while with no
              > > > problems.
              > > > I just upgraded to 2.6.0 and am having an issue only with
              > > (surprise, surprise) IE. Works
              > > > fine in Firefox and Safari. This is with IE 7 and IE 8b2.
              > > >
              > > > I have narrowed down the problem I think as follows:
              > > > If the underlying XML data has empty nodes, IE wonks out. If
              it
              > > doesn't, IE works.
              > > > For example:
              > > > Say you have 4 fields, A, B, C and D.
              > > > Let's say A, B and C always have data, but D comes over as
              > <D></D>
              > > (empty).
              > > > IE wonks out. If you remove D from the DataSource's
              > > responseSchema, IE works just fine.
              > > > IE also seems to be having trouble with formatters.
              > > >
              > > > This may not be the actual cause or underlying reason, but
              it's
              > > the thing that seems to be
              > > > causing it. This wasn't the case in 2.5.X, the same data
              loaded
              > > fine in IE.
              > > >
              > > > I have tried the old DataSource and the new XHRDataSource
              > > constructors, etc no
              > > > difference.
              > > >
              > > > Anybody have any suggestions?
              > > >
              > > > Thanks!
              > > >
              > >
              >
            • Amy
              I have noticed the same problem - but not only in IE. I m seeing it in Firefox 3.0.5 as well. If I have an empty element in the XML, all elements that precede
              Message 6 of 8 , Dec 19, 2008
              • 0 Attachment
                I have noticed the same problem - but not only in IE. I'm seeing it
                in Firefox 3.0.5 as well.

                If I have an empty element in the XML, all elements that precede it in
                the schema are displayed as blank.

                My code:
                [code]
                function runReport(reportName){

                var parameters = {reportName: reportName, pageName: 'module',
                asynchronous: true, func:'runreport_xml',module:'reports'};


                new Ajax.Request('index.php',
                {
                method:'get',
                parameters: parameters,
                onSuccess: function(transport){
                var xmlDoc = transport.responseXML || "Error";
                var headers = xmlDoc.getElementsByTagName('DBHeader');

                var formatUrl = function(elCell, oRecord, oColumn, sData) {
                if(sData){

                elCell.innerHTML = "<a href='" +
                oRecord.getData("editurl") + "'>" + sData + "</a>";
                }
                };
                var myColumnDefs = [];
                var fieldsArray = [];

                for(i=0;i<headers.length;i++){
                clean_header = headers[i].firstChild.nodeValue.replace(/
                /g,'');
                clean_header = clean_header.replace(/:/g,'');
                alert(clean_header);
                fieldsArray[i] = {key:clean_header};
                myColumnDefs[i] = {key:clean_header,
                label:headers[i].firstChild.nodeValue, sortable:true,formatter:formatUrl};
                }

                ReportTable = function() {
                var myDataSource, myDataTable;

                myDataSource = new YAHOO.util.DataSource(xmlDoc);

                myDataSource.responseType =
                YAHOO.util.DataSource.TYPE_XML;
                myDataSource.responseSchema = {
                resultNode: "DBData",
                fields: fieldsArray
                };

                myDataTable = new YAHOO.widget.DataTable("reportBody",
                myColumnDefs, myDataSource);

                return {
                oDS: myDataSource,
                oDT: myDataTable
                };
                }();





                }
                });




                }
                [/code]


                My XML Response:

                [code]
                <?xml version="1.0" encoding="UTF-8"?>

                <RecordList>

                <Headers>

                <DBHeader>Patient: Last</DBHeader>

                <DBHeader>Patient Home Phone:</DBHeader>

                <DBHeader>Patient: First</DBHeader>

                </Headers>

                <DBData>

                <PatientLast>Turner </PatientLast>

                <PatientHomePhone></PatientHomePhone>

                <PatientFirst>Ted</PatientFirst>

                </DBData>

                </RecordList>
                [/code]
              • Frank Dietrich
                - Mail came back so I retry - ... There is a reported Bug in the DataSource. I think it s the one that bites here If You hold the YUI-stuff local, this can be
                Message 7 of 8 , Dec 19, 2008
                • 0 Attachment
                  - Mail came back so I retry -

                  >I have noticed the same problem - but not only in IE. I'm seeing it
                  >in Firefox 3.0.5 as well.
                  >
                  >If I have an empty element in the XML, all elements that precede it in
                  >the schema are displayed as blank.


                  There is a reported Bug in the DataSource. I think it's the one that bites here
                  If You hold the YUI-stuff local, this can be easily fixed. Function parseXMLResult
                  throws an exception as soon as it falls over an empty node. In this case firstChild
                  is null but due to the bug that does not get checked and firstChild.nodeValue
                  then causes the exception.

                  Either You make sure Your nodes are not empty or You fixe the line 1255 the datasource.js:

                  .....

                  // 2008-11-29
                  // BugFix
                  // if(xmlNode && xmlNode.item(0) && xmlNode.item(0)) {
                  if(xmlNode && xmlNode.item(0) && xmlNode.item(0).firstChild) {

                  .....

                  and/or at the corresponding position in datasource-min.js

                  It then should work


                  HTH

                  Frank




                  www.dd-tech.de - www.personalplanung.com - www.kulturbox.de
                • Amy
                  Yep. Thanks, Frank. I found the answer in another thread and patched my local version. Works like a charm now. Amy
                  Message 8 of 8 , Dec 23, 2008
                  • 0 Attachment
                    Yep. Thanks, Frank. I found the answer in another thread and patched
                    my local version. Works like a charm now.

                    Amy
                  Your message has been successfully submitted and would be delivered to recipients shortly.