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

type ODATA - no additional parameters??

1 Answer 175 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Karl
Top achievements
Rank 1
Karl asked on 03 Jan 2012, 04:07 PM
If I set the type of datasource to "odata" additional parameters is not added to the request string. This is my code:

var odataSource = new kendo.data.DataSource({
    type: 'odata',
    transport: {
        read: {
            url: server + query, // the service url
            data: { //additional parameters sent to the remote service
                buchungskonto: function() {
                    return "'" + $("#search").val() + "'";
                }
            }
        }
    },
    change: function() { // subscribe to the CHANGE event of the data source
        $("#results").html(kendo.render(template2, this.view()));
    }
});

The resulting request is:

/my.services/SalesData/GetCustomers()?$format=json&$inlinecount=allpages&$callback=callback

As you can see parameter "buchungskonto" is missing. It is a call to a wcf data service, GetCustomers() is mapping to some SP, "buchungskonto" one of the parameters passed to the SP. So the correct call should be:

/my.services/SalesData/GetCustomers()?$format=json&$inlinecount=allpages$callback=callback&buchungskonto='1'

Is this a bug?

Besides that: really great product! BUT, and this is a really big BUT: the documentation is not on the level I'm accustomed to from telerik. I think there is still a lot of work to do for you.

Regards
Heiko

1 Answer, 1 is accepted

Sort by
0
Sovan
Top achievements
Rank 1
answered on 11 Jan 2012, 01:57 PM
@karl:  omitting the quotes like

return $("#search").val();

can be the solution.
Tags
Data Source
Asked by
Karl
Top achievements
Rank 1
Answers by
Sovan
Top achievements
Rank 1
Share this question
or