I have a question about changing the datasource in Kendo.
Currently my dataSource and Kendo List View looks something like below:
var DSOne = new kendo.data.DataSource({
dataType: 'json',
transport: {
read:
{
url: DS_URL_1,
type: "GET",
xhrFields: { withCredentials: true },
crossDomain: true
}
},
pageSize: 9,
serverPaging: false
});
var DSTwo = new kendo.data.DataSource({
dataType: 'json',
transport: {
read:
{
url: DS_URL_2,
type: "GET",
xhrFields: { withCredentials: true },
crossDomain: true
}
},
pageSize: 9,
serverPaging: false
});
var viewModel = kendo.observable({
apps: DSOne
});
kendo.bind(jQuery('#listViewID'), viewModel);
$("#pager").kendoPager({
dataSource: DSOne
});
And what I want to be able to is when I click on a button to change the dataSource for the viewModel and the pager so that new data loads into #listViewID