Is there a sample somewhere of doing RESTFUL CRUD operations on the datasource?
I.e. I need to be able to have all changed records get posted in an json array to a PUT method, Inserts to a POSt in a json array, and deletes as the URL with a parameter repeated for each of the primary keys for the deleted records.
I'm not finding any documentation on how to do this at all, and the samples are only showing a single "update" url instead of broken down ones.
Thanks for any assistance!
It's absolutely not as simple was WCF Data-Services.
Web API handles things VERY much differently and the writting is on the wall that WCF Data-Services is on the way out.
Web API + knockout + upshot = RIA for javascript and is the Microsoft way going forward. It is also the way that MS is going to support for standard REST services even if you don't use upshot. (which is crippled because it can't work against non-entities and doesn't support projections so it wastes resources by doing SELECT * on everything!.
Hence any implementation needs to work on true REST services. It needs to also be able to work on WCF Data-Services for backwards compatibility.
I think what we are talking about is pretty simple and can easily be understood by looking at this page.
http://www.plippard.com/post/2010/10/06/CRUD-OData-WCF-Data-Services.aspx
He also links to Microsoft's javascript implementation which is similar in usage but I believe has support for batch operations as well which might be useful. All of this comes for free with a WCF Data Service - so in theory all you would need is one or more HTML pages with a grid in it, and a data services backend to accomplish quite a lot.
While I am well acquainted with silverlight xamgrid yesterday was the first time I had looked at your jquery offering and I have to say other than this issue, I'm fairly impressed with what all it can do and how well thought out the templating is. Much more flexible than xamgrid, even though I love c# and sometimes hate javascript with a passion. :-)
OData relies on REST. The most obvious of this is the GET, but it also POSTs Inserts, PUTS updates, AND DELETES deletes.
OData burries the actual data in the response because of meta data that is required for MS's change tracking and strong typing in Silverlight (and now upshot) but it's just JSON arrays. Same for the POSTS, AND PUTS.
Where every one of your competitors is getting it wrong is DELETE. If you get all of these right and can handle WebAPI propertly (which is the closest of all of them to true rest) and RoR's out of the box functionality you'll really be rolling.
A DELETE request is always done in the URI. That is, the KEY is passed as a parameter. But more so, a batch can still be done with DELETE contrary to a lot of people's assertions. This is the valid, RFC standards compliant way to do a batch delete
<someurl>/delete?ID=5&ID=7&ID=9&ID10
That is, repeat the name of the Key and pass the values. In WebAPI and WCF this will be handled by the parameter on the Delete function being IEnumerable<KeyType>. Similar is also supported in other languages.
By implementing it this way and handling both Odata get return syntax and WebAPI pure array or single object return syntax, and post/puting pure json arrays you'll have rest done right with full Odata support as well.
Combine that with enabling direct knockout binding on your editors when not in a grid that works, and you'll have a killer product.
I'm more than happy to test out early code for you, as I have a lot of experience (unfortunately) making this stuff work and ensure that it's correct.
Thanks for the valuable feedback! :)
AFAIK, the OData itself doesn't define anything specific to REST, it's only defining how entities (resources) are being addressed, and how the URL should be constructed, in order to perform paging, sorting, filtering, querying (lazy /deferred loading), and so on. We do support OData in that sense, and we have a sample using the Hierarchical grid. Once REST support comes out of the box, it will and should work with the OData way of addressing resources, for sure.
I've started to work on a REST sample - meaning the REST API itself, as defined by RFCs, but haven't got a chance to complete it.
Also FYI, we have added this feature as top priority for our next release - 12.2.
Hope it helps, and again, thanks for sharing your thought guys - it really helps us improve the product.
Angel
According to support it's not possible without using their hack.
Unfortunately it appears that Infragistics jquery is not ready for any REST applications, Odata or otherwise. (even though it clearly shows in the graphic about the data source that it does support REST)
I gotta wonder why so many companies will eagarly show you read, but can't get full CRUD right with REST. (i.e. every single one that does sort of support REST out there doesn't get deletes right and violates RFC rules and posts data to the body of DELETE, which isn't allowed, all parameters must be in the URI)
Infragistics this is your opportunity to shine if you get this right and give us a truly REST service that handles things correctly.