YUI - Datasource question

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top