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

Re: DataTable XHR problems

Expand Messages
  • jennykhan
    Hi there, Please check out item number 2 in the following thread: http://tech.groups.yahoo.com/group/ydn-javascript/message/10696 Thanks, Jenny ...
    Message 1 of 2 , Mar 13, 2007
      Hi there,

      Please check out item number 2 in the following thread:
      http://tech.groups.yahoo.com/group/ydn-javascript/message/10696

      Thanks,
      Jenny





      --- In ydn-javascript@yahoogroups.com, "gvnbpt" <gvnbpt@...> wrote:
      >
      > I finally, after a LOT of different trying (giving up on XML & JSON
      > formats), finally got to the following that works with a text file.
      > However, why is the FIRST line of my text file being ignored? I get
      > all the data in my table EXCEPT for the first line. Here is my text
      file:
      >
      > Acme,President,John Smith,800-555-1212,johnsmith@...
      > Foobar,CEO,Jane Doe,800-555-1212,janedoe@...
      >
      > (I'm only getting the 2nd line displayed in my table). The full html
      > page I have is this:
      >
      > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
      > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      > <html xmlns="http://www.w3.org/1999/xhtml">
      > <head>
      > <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
      > <title>BizData Presentation</title>
      > <link type="text/css" rel="stylesheet"
      > href="yui/build/datatable/assets/datatable.css">
      > <script type="text/javascript"
      > src="http://www.json.org/json.js"></script>
      > <script type="text/javascript"
      > src="yui/build/yahoo/yahoo.js"></script>
      > <script type="text/javascript"
      > src="yui/build/dom/dom.js"></script>
      > <script type="text/javascript"
      > src="yui/build/event/event.js"></script>
      > <script type="text/javascript"
      > src="yui/build/connection/connection.js"></script>
      > <script type="text/javascript"
      > src="yui/build/logger/logger.js"></script>
      > <script type="text/javascript"
      > src="yui/build/dragdrop/dragdrop.js"></script>
      > <script type="text/javascript"
      > src="yui/build/datasource/datasource-beta-debug.js"></script>
      > <script type="text/javascript"
      > src="yui/build/datatable/datatable-beta-debug.js"></script>
      > <script type="text/javascript">
      >
      > function loadData() {
      > var logContainer =
      > document.body.appendChild(document.createElement("div"));
      > var logReader = new
      YAHOO.widget.LogReader(logContainer);
      > var bizColumnHeaders = [ {key:"Company",
      text:"Company"},
      > {key:"Title", text:"E-Mail"},
      > {key:"Name", text:"Street
      > Address"},
      > {key:"Phone", text:"Phone"},
      > {key:"Email", text:"Web Site"}
      > ];
      > var bizColumnSet = new YAHOO.widget.ColumnSet(
      > bizColumnHeaders );
      > var bizDataSource = new
      > YAHOO.util.DataSource("./bizlist.txt");
      > bizDataSource.responseType =
      > YAHOO.util.DataSource.TYPE_TEXT;
      > bizDataSource.responseSchema = {
      > recordDelim: "\n",
      > fieldDelim: ",",
      > fields: ["Company","Title","Name","Phone","Email"]
      > };
      > var bizDataTable = new YAHOO.widget.DataTable(
      > "biztable_container", bizColumnSet, bizDataSource);
      > }
      > </script>
      > <head>
      > <body>
      > Click <input type="button" value="here"
      > onClick="javascript:loadData();"> to load data.<BR>
      > <div id="biztable_container"></div>
      > </body>
      > </html>
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.