문제

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!

도움이 되었습니까?

해결책

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 "".

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top