Where did .WebApi() go?

3 posts, 0 answers
  1. Caleb Sandfort
    Caleb Sandfort avatar
    35 posts
    Member since:
    Mar 2008

    Posted 16 Feb Link to this post

    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. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 17 Feb Link to this post

    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
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Caleb Sandfort
    Caleb Sandfort avatar
    35 posts
    Member since:
    Mar 2008

    Posted 17 Feb in reply to Hristo Valyavicharski Link to this post

    It appears that .WebApi() was the same as .Ajax(), and probably why it was removed, so calling .Ajax() works.
Back to Top