I just started using the yui libraries yesterday and I want to use the datatable. I can't seem to get it to display my xml file in a table. It gives the error "Data Error" and "No records found" if I try to sort any columns.
I have even tried exact code from their sample with XHR for XML and that works for their datasource. However, If I modify the fields and url to work for my local xml file, it gives me the error.
The XML file is local, on my desktop, as are my html files. I have the yui libraries linked locally as well.
This is my exact js code. I have imported the dom.js, event.js, connection.js, datasource-beta-debug.js, datatable-beta-debugs.js before this section of code.
My data.xml file is formated correctly as far as I know.
The css for the table is displayed properly, just no data except that error message. I am using Firefox 2. I have tried it on IE6 too. In IE6, when linked to my xml file, the table does not even show.
Any suggestions?
I have even tried exact code from their sample with XHR for XML and that works for their datasource. However, If I modify the fields and url to work for my local xml file, it gives me the error.
The XML file is local, on my desktop, as are my html files. I have the yui libraries linked locally as well.
This is my exact js code. I have imported the dom.js, event.js, connection.js, datasource-beta-debug.js, datatable-beta-debugs.js before this section of code.
var myColumnHeaders = [
{key:"id", text:"Name", sortable:true},
{key:"desc"},
{key:"amount"},
];
var myColumnSet = new YAHOO.widget.ColumnSet(myColumnHeaders);
var myDataSource = new YAHOO.util.DataSource("data.xml");
myDataSource.responseType = YAHOO.util.DataSource.TYPE_XML;
myDataSource.responseSchema = {
resultNode: "result",
fields: ["id","desc","amount"]
};
var myDataTable = new YAHOO.widget.DataTable("xml", myColumnSet, myDataSource);
My data.xml file is formated correctly as far as I know.
The css for the table is displayed properly, just no data except that error message. I am using Firefox 2. I have tried it on IE6 too. In IE6, when linked to my xml file, the table does not even show.
Any suggestions?