This is a migrated thread and some comments may be shown as answers.

Data Source Comes Up Empty

1 Answer 60 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 10 Jul 2012, 11:41 AM
Hi I am using this piece of code to pull a data source from a webservice but it keeps coming up empty. Funny thing is that I actually just copy and pasted the exact code from elsewhere in my site where it was working perfectly and just changed the variables. Anyone know why this would be happening.

Code:
searchInit is being called from document.ready.
Here is the url for the webservice: http://itracdev.com/scripts/db/partners.php?task=select&subtask=getContacts&EEID=1&ClientID=1
The console.log(searchPartnerSource) and empty data object.

function searchInit(){
    console.log('ClientID = '+clientID);
    var searchPartnerSource = new kendo.data.DataSource({
        transport: {
            read:"/scripts/db/partners.php?task=select&subtask=getContacts&EEID="+eeMemberID+"&ClientID="+clientID
        },
        schema: {
            data: "data"
        },
        pageSize: 5
     });
     
    console.log(searchPartnerSource);
}

1 Answer, 1 is accepted

Sort by
0
Phil
Top achievements
Rank 1
answered on 19 Jul 2012, 01:45 PM
Hi Kevin,

At the point where you're logging searchPartnerSource to the console, you haven't read anything.  You need to either use it in a control which binds to the datasource or manually trigger a read on the datasource (ex. searchPartnerSource.read()).  At least that's my guess as to why it appears empty; I'm still learning this myself.  :)

Phil
Tags
Data Source
Asked by
Kevin
Top achievements
Rank 1
Answers by
Phil
Top achievements
Rank 1
Share this question
or