I have a simple DataSource using Everlive as the Transport:
var gamesDataSource = new kendo.data.DataSource({
type: 'everlive',
schema: {
model: activityModel
},
transport: {
typeName: 'Games'
},
sort: { field: 'CreatedAt', dir: 'desc' },
filter: { field: "UserId", operator: "eq", value: null }
});
My Model is pretty simple too:
var activityModel = {
id: 'Id',
fields: {
Score: {
field: 'Score',
defaultValue: ''
},
Type: {
field: 'Type',
defaultValue: ''
},
UserId: {
field: 'UserId',
defaultValue: null
}
}
};
The intent of this is to pull back "Games" from our Everlive DataSource and bind to a listview. It works. But, I need more information from other tables and other APIs. For example: I want to put a persons current Facebook picture to associate to the user that came back. I have their Facebook Id already. However, the schema/model only seems to be able to let me put a "return" there. I can't figure out how to do asynchronous calls for a field. Ex:
var activityModel = {
id: 'Id',
fields: {
Score: {
field: 'Score',
defaultValue: ''
},
Type: {
field: 'Type',
defaultValue: ''
},
UserId: {
field: 'UserId',
defaultValue: null
},
Picture: {
//async call to JSON to bind picture
}
}
};
Anyways, I am not bound to the idea of doing an async call in the schema/model. But, I do need to find a way to do async calls as a "join" to fill in information bound to my datasource.
Any ideas?