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

Where did .WebApi() go?

2 Answers 143 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Caleb Sandfort
Top achievements
Rank 1
Caleb Sandfort asked on 16 Feb 2016, 11:42 PM

Hi

 I'm attempting to wire up a Kendo grid to a web api.  I found two great examples on the site: here and here.

 Basically says configure the data source like this:

 

.DataSource(dataSource => dataSource
            .WebApi()
            .Model(model =>
            {
                model.Id(product => product.ProductID); // Specify the property which is the unique identifier of the model
                model.Field(product => product.ProductID).Editable(false); // Make the ProductID property not editable
            })
            .Create(create => create.Url(Url.HttpRouteUrl("DefaultApi", new { controller = "Products" }))) // Action invoked when the user saves a new data item
            .Read(read => read.Url(Url.HttpRouteUrl("DefaultApi", new { controller = "Products" }))) // Action invoked when the grid needs data
            .Update(update => update.Url(Url.HttpRouteUrl("DefaultApi", new { controller = "Products", id = "{0}" })))  // Action invoked when the user saves an updated data item
            .Destroy(destroy => destroy.Url(Url.HttpRouteUrl("DefaultApi", new { controller = "Products", id = "{0}" }))) // Action invoked when the user removes a data item
      )

 

 I'm using version 2016.1.112 and .WebApi() isn't available.  Any idea how the hook the data source to a web api without it?

2 Answers, 1 is accepted

Sort by
0
Hristo Valyavicharski
Telerik team
answered on 17 Feb 2016, 01:30 PM
Hi,

WebApi() should be available. Please try to clean and rebuild. Maybe the Visual Studio editor is not refreshed.

Regards,
Hristo Valyavicharski
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Caleb Sandfort
Top achievements
Rank 1
answered on 17 Feb 2016, 06:19 PM
It appears that .WebApi() was the same as .Ajax(), and probably why it was removed, so calling .Ajax() works.
Tags
Grid
Asked by
Caleb Sandfort
Top achievements
Rank 1
Answers by
Hristo Valyavicharski
Telerik team
Caleb Sandfort
Top achievements
Rank 1
Share this question
or