M
MAB
I am using asp to produce xml data. The data successfully loads into
the YUI datatable using the code below unless I try to pass a
parameter to
my asp page.
Using var url="test.asp", the datatable loads without any problems,
however if I use var url="test.asp?q=p" the table does not load. I
tested the asp page and it runs fine with the parameter. If I put the
same parameter inside the asp page and send the request without a
parameter (creates the same data but does not make it dynamic), the
table loads fine.
Is there an issue with the "?" character and dataSource or XHR?
Any help will be greatly appreciated.
<script type="text/javascript">
var myColumnHeaders = [
{key:"Name", text:"Name", type:"string", sortable:true,
resizeable:true,width:'170px'},
{key:"City", text:"City", type:"string", sortable:true,
resizeable:true,width:'100px'},
{key:"State", text:"State", type:"string", sortable:true,
resizeable:true, className:"State",width:'20px'},
{key:"SqFt", text:"SF", type:"number", sortable:true,
resizeable:true, className:"SF", width:'100px'}
];
var myColumnSet = new YAHOO.widget.ColumnSet(myColumnHeaders);
// Point to a local or proxy URL
var url="test.asp"
var myDataSource = new YAHOO.util.DataSource(url);
// Set the responseType as XML
myDataSource.responseType = YAHOO.util.DataSource.TYPE_XML;
// Define the data schema
myDataSource.responseSchema = {
resultNode: "item", // Node name of each result item
fields: ["Name", "City", "State", "SqFt"] // Field names
};
var initialRequest = "get=all&output=xml";
var oConfigs = {
caption:"Example: Paginated Over XHR",
initialRequest:initialRequest,
pageCurrent: 1,
rowsPerPage: 100,
startRecordIndex: 1,
pageLinksLength: 10,
rowsPerPageDropdown: [25,50,100,500]
};
var myConfigs = {
caption:"Example: Changed Data - ",
//scrollable: true,
//sortedBy:"state",
//sortedByDir:"asc",
//fixedWidth: false,
pageCurrent: 1,
rowsPerPage: 10,
startRecordIndex: 1,
rowsPerPageDropdown: [10,15,25,50,100]}
fnCallback = function(){
var myDataTable = new YAHOO.widget.DataTable("basic", myColumnSet,
myDataSource, myConfigs);
}
YAHOO.util.Event.onAvailable("basic", fnCallback);
</script>
the YUI datatable using the code below unless I try to pass a
parameter to
my asp page.
Using var url="test.asp", the datatable loads without any problems,
however if I use var url="test.asp?q=p" the table does not load. I
tested the asp page and it runs fine with the parameter. If I put the
same parameter inside the asp page and send the request without a
parameter (creates the same data but does not make it dynamic), the
table loads fine.
Is there an issue with the "?" character and dataSource or XHR?
Any help will be greatly appreciated.
<script type="text/javascript">
var myColumnHeaders = [
{key:"Name", text:"Name", type:"string", sortable:true,
resizeable:true,width:'170px'},
{key:"City", text:"City", type:"string", sortable:true,
resizeable:true,width:'100px'},
{key:"State", text:"State", type:"string", sortable:true,
resizeable:true, className:"State",width:'20px'},
{key:"SqFt", text:"SF", type:"number", sortable:true,
resizeable:true, className:"SF", width:'100px'}
];
var myColumnSet = new YAHOO.widget.ColumnSet(myColumnHeaders);
// Point to a local or proxy URL
var url="test.asp"
var myDataSource = new YAHOO.util.DataSource(url);
// Set the responseType as XML
myDataSource.responseType = YAHOO.util.DataSource.TYPE_XML;
// Define the data schema
myDataSource.responseSchema = {
resultNode: "item", // Node name of each result item
fields: ["Name", "City", "State", "SqFt"] // Field names
};
var initialRequest = "get=all&output=xml";
var oConfigs = {
caption:"Example: Paginated Over XHR",
initialRequest:initialRequest,
pageCurrent: 1,
rowsPerPage: 100,
startRecordIndex: 1,
pageLinksLength: 10,
rowsPerPageDropdown: [25,50,100,500]
};
var myConfigs = {
caption:"Example: Changed Data - ",
//scrollable: true,
//sortedBy:"state",
//sortedByDir:"asc",
//fixedWidth: false,
pageCurrent: 1,
rowsPerPage: 10,
startRecordIndex: 1,
rowsPerPageDropdown: [10,15,25,50,100]}
fnCallback = function(){
var myDataTable = new YAHOO.widget.DataTable("basic", myColumnSet,
myDataSource, myConfigs);
}
YAHOO.util.Event.onAvailable("basic", fnCallback);
</script>