Hi,
I am using CodeIgniter on my backend to return a JSON result, depending on parameters sent via a POST. I wanted to directly link the result to a Grid, via a DataSource. However, I am having problems either understanding DataSources, or how they pass parameters.
In the examples, you provide:
var dataSource = new kendo.data.DataSource({
transport: {
read: {
// the remote service URL
url: "http://search.twitter.com/search.json",
// JSONP is required for cross-domain AJAX
dataType: "jsonp",
// additional parameters sent to the remote service
data: {
q: function() {
return $("#searchFor").val();
}
}
}
}
If I want to test this, I simply use a browser to check "
" and it returns what would appear in the DataSource above.
The problem is that CodeIgniter does not accept parameters in the form of "?q=whatever" as standard. It can, however, accept GET and POST information.
How can I do it? I have a few theories:
1. set up the DataSource correctly to pass the parameters in a GET or POST (how?)
2. do not use a DataSource, but a javascript object to bind to the Grid (seems like a waste, how is this done?)
3. extend DataSource like you did with odata to make a special class that knows how to handle parameters in GET/POST.
What would you recommend?