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

AJAX ListView not calling controller actions in .NET Core

2 Answers 135 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 1
Adam asked on 24 Jul 2016, 09:36 PM

public class FavoritesController : Controller
    {
        public IActionResult Favorites_Read([DataSourceRequest] DataSourceRequest request)
        {
            ...

            return Json(listings.ToDataSourceResult(request));
        }
    }

 

@(Html.Kendo().ListView<ListingDetails>()
    .Name("listView")
    .TagName("div")
    .ClientTemplateId("listingTemplate")
    .Pageable()
    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(5)
        .Model(model => model.Id(p => p.ID))
        .Create(update => update.Action("Favorites_Create", "Favorites"))
        .Read(read => read.Action("Favorites_Read", "Favorites"))
        .Update(update => update.Action("Favorites_Update", "Favorites"))
        .Destroy(update => update.Action("Favorites_Delete", "Favorites"))
    )
    .Deferred()
    )

 

I've set a breakpoint at the beginning of Favorites_Read, but the action is not being hit. Any help would be greatly appreciated.

2 Answers, 1 is accepted

Sort by
0
Adam
Top achievements
Rank 1
answered on 24 Jul 2016, 09:37 PM
I should mention that I am also not getting any javascript errors on load.
0
Konstantin Dikov
Telerik team
answered on 27 Jul 2016, 08:46 AM
Hi Adam,

Can you please test the same without the Deferred and see if it will make any difference? If it does, please ensure that you are calling the DeferredScripts method as documented in the following help article:
I am looking forward to your reply with the results.


Regards,
Konstantin Dikov
Telerik by Progress
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
Tags
ListView
Asked by
Adam
Top achievements
Rank 1
Answers by
Adam
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Share this question
or