Hello KendoUI Gurus -
I am using a datasource and an external API (Parse.com) to grab data and populate it into a Pull-to-Refresh list view. All works well, however I am filtering the data using Kendo's "FILTER" (meaning I retrieve ALL records from the cloud first, and then apply a filter - which isn't going to work as the table grows, or at best horrible inefficient) I need to filter the data at the query level - the ajax code below works fine
Question:
Is there anywhere I can put this line of code in the Kendo datasource configuration to have this line of code run in the AJAX request.
Below is a link to some documentation on their site, I understand that it's an external service and that you may not support it, but I would like to double check with you and hopefully you can advise me on how to achieve what I need to do
Thanks in advance,
Regards
Darren
Ajax Working Code:
var listingdataSource = new kendo.data.DataSource({
serverPaging: true,
pageSize: 10,
filter: { field: "messageTo", operator: "eq", value: localStorage.ls_userid},
sort: { field: "createdAt", dir: "desc" },
transport: {
data: 'where={"username":"someUser"}',
read: {
type: 'GET',
headers: {'X-Parse-Application-Id':'xxx','X-Parse-REST-API-Key':'xxx'},
url: "https://api.parse.com/1/classes/Messages",
dataType: "json" // JSONP (JSON with padding) is required for cross-domain AJAX
},
},
schema: { // describe the result format
data: "results", // the data which the data source will be bound to is in the "results" field
}
});
PARSE.COM REST API:
https://parse.com/docs/rest
I am using a datasource and an external API (Parse.com) to grab data and populate it into a Pull-to-Refresh list view. All works well, however I am filtering the data using Kendo's "FILTER" (meaning I retrieve ALL records from the cloud first, and then apply a filter - which isn't going to work as the table grows, or at best horrible inefficient) I need to filter the data at the query level - the ajax code below works fine
Question:
Is there anywhere I can put this line of code in the Kendo datasource configuration to have this line of code run in the AJAX request.
data: 'where={"username":"someUser"}',
Thanks in advance,
Regards
Darren
Ajax Working Code:
$.ajax({
type: 'GET',
headers: {'X-Parse-Application-Id':'PARSE-APP-ID','X-Parse-REST-API-Key':'PARSE-REST-KEY'},
url: "https://api.parse.com/1/Messages",
data: 'where={"username":"someUser"}',
contentType: "application/json"
});
Kendo UI DataSource:var listingdataSource = new kendo.data.DataSource({
serverPaging: true,
pageSize: 10,
filter: { field: "messageTo", operator: "eq", value: localStorage.ls_userid},
sort: { field: "createdAt", dir: "desc" },
transport: {
data: 'where={"username":"someUser"}',
read: {
type: 'GET',
headers: {'X-Parse-Application-Id':'xxx','X-Parse-REST-API-Key':'xxx'},
url: "https://api.parse.com/1/classes/Messages",
dataType: "json" // JSONP (JSON with padding) is required for cross-domain AJAX
},
},
schema: { // describe the result format
data: "results", // the data which the data source will be bound to is in the "results" field
}
});
PARSE.COM REST API:
https://parse.com/docs/rest