Make Kendo DataSource Compatible with ASP.NET MVC 4 Web API
If possible, please consider making the Kendo DataSource compatible with the data returned from using an ASP.NET MVC 4 Web API project possibly by adding a 'webapi' dataType.
Thanks for sharing your idea. I’ll communicate it with the team.
Stephen Byrne commented
Yes please, please include "out of the box" support for Web API, don't care about OData just want a proper MVC helper for the grid that will behave correctly out of the box.
Have spent the last 3 days faffing about and reading virtually every article on the support site just to get basic functionality working with Web API. You end up having to copy and paste swathes of code from different sources which you may or may not be lucky enough to find without having to read the entire forums....
That is great. So does that mean it will appear in the next release?
Vesselin Obreshkov commented
Well considering they've added full oData support now maybe you guys can close this (and give me back my votes :)? Even without oData you can easily implement whatever is needed.
Kendo already has an odata source. It is straight forward to adapt (i.e. copy the odata.js file) and make it work properly with Web API... except for one thing: They need to provide a flag that will enduce Deletes to be passed in the URL instead of in the body. They need to do this for not just Web API but anything hosted on Amazon and google as well, because you must use the URL for these services just like Web API requires it in the URL too.
So for those of you that are looking for Kendo to fix this, just use what they already give and make minor tweaks to their code for odata and your'e good to go. I already have one done.
Any news on that??
Wayne Brantley commented
More appropriate, this should be called - implement easy and direct standards based REST support for your datasource, which a grid then uses, etc.
If they do that, then Web API should be fine as it is just a REST framework.
Pinaki Mukherjee commented
I am also trying to instigate webapi data in KendoUI grid. But i fail to do that . I am also wasting my 3 days in this R&D. It will be great if it will possible. Please give some solution with well documentation and DEMO.
WebApi support would be a great asset for the product.
This would be a really, really great feature to have that I would love to use!
I've asked my boss o buy a licence but for new projects web api support is very very important. Thanks for consider this.
This is the reason I propsed the Kendo Grid to my client! I am trying to make it easy for their developers to pick up what I code for them.
Thank you for considering this. I think that including this feature would be very helpful.
@Anonymous: 8 days ago they reverted the fix you mentioned, and we're back to jQuery including the request body and forcing you to manually specify data on the request URI. So, um, technically not a bug then.
There's some good news on this front: http://bugs.jquery.com/ticket/11586
While Kendo wasn't willing to fix the obvious bug in JQuery themselves, jQuery agrees with me and is fixing it. It may not get into 1.8 of jQuery but it will be fixed.
That should tell Kendo that it's a real bug and Kendo should be fixing it themselves. With the exception of the DELETE issue I have a fully working datasource extender that works similiarily to the odata one for WebAPI.
I agree with James.
The documentry is very missing.
It lacks details like - When the events are being called? Only once or everytime? etc.
For template there are few examples but no documentation that describes all the possibilities.
WebApi support is VERY important.
FYI, while the blog entry is helpful, it brings up a major issue which is the magic methods on the datasource. It needs to be MUCH better documented and there needs to be events for when a filter, sort, or page is requested so that we can intercept and override what occurs (and tell it how to parse the responses too).
Right now I feel like it's a black box, even after reading all of the documentation, seeing the demos and watching the video.
For those of you that want a very seamless solution, check in the forums. I posted code that allows you to post as json, enable server side sorting, filtering, and paging, and get back a response that doesn't require custom parsing.
I also posted instructions on how to enable $select functionality so that you can now do projections as well with Web API and Kendo will handle them properly.
And it's built in such a way that when MS does update the stack to support $select, it's removal of one method. When they do support a true odata json response set, it's removal of another method and find and replace to tell Kendo to use OData instead.
Other solutions require every method have a special signature etc. which doesn't cut it considering how much this is changing and how quickly.
I'd really love to see integration with upshot however.
Web API doesn't use OData. SPA enables partial OData through the IQueryable interface. As I've been reminded by MS people in the last few days this support is in the highly Alpha SPA not in Web API.
Although the writing is on the wall that RIA Services is dead and this is the approach going forward.
Unfortunately SPA's OData doesn't support $select right now so it's largely useless for listing data. :<
I'm working on a solution that will do this automatically though and give it $select.
According to support, it mostly works with the current OData in SPA... I'm trying it out today.
Jeff Harris commented
maybe an upshot binding?