Question

I'm using post, and the YUI documentation example code isn't working.

YAHOO.util.Event.addListener(window,"load",function()
{

    var columnDefs = 
    [ 
        {key:"url", sortable:true, resizeable:true}, 
        {key:"title", sortable:true, resizeable:true}, 
        {key:"count", sortable:true, resizeable:true} 
    ];

    this.dataSource = new YAHOO.util.DataSource("/getallsites/");
    this.dataSource.responseType = YAHOO.util.XHRDataSource.TYPE_JSON;
    this.dataSource.connMethodPost = true;
    this.dataSource.responseSchema = 
    {
        fields:["url","title","count"]    
    };

    this.myDataTable = new YAHOO.widget.DataTable("siteTable",columnDefs,this.dataSource,
        {initialRequest:"/getallsites/"});


});

The /getallsites/ returns a JSARRAY. I wanted to get the JSARRAY to work before I converted it to JSON. The Django server log isn't even recognizing a request to /getallsites/. Any ideas?

Thanks!

Was it helpful?

Solution

First, make sure you are including the Connection Manager utility on the page.

Second, the way you have it configured, the request will go to /getallsites//getallsites/, so try setting initialRequest to "".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top