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

Missing Action on Destroy URL

1 Answer 126 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Christopher
Top achievements
Rank 1
Christopher asked on 30 Jul 2015, 12:51 PM

Found an issue when displaying a list of items and deleting.   Kendo seems to be picking up on the “k-grid-delete” style and showing the confirmation correctly, but if I delete multiple rows(one at at time), the action name for the first delete call is missing from the URL.

For the first call and only for the first call it looks like “http://localhost:58501/Application/WholesaleLicense?permitApplicationId=d562e244-2093-488a-aec1-a4e300a72881” instead of “http://localhost:58501/Application/WholesaleLicense/Delete?permitApplicationId=d562e244-2093-488a-aec1-a4e300a72881”.

When calling delete the second time it works fine.  It doesn’t matter which row ​is deleted first​ so it’s not that the first row of the grid is somehow rendered differently.

Is there a fix for this?  See code below.  

@using (Html.BeginForm("IndexPost", "WholesaleLicense", FormMethod.Post, new { id = "ApplicationNavigationForm", Area = "Application" }))
{
    @Html.Partial("_NewApplicationProcessHeader", Model)

    <div class="panel-body">
        @(Html.Kendo().Grid<WholesaleLicenseDetailViewModel>()
              .Name("licenseGrid")
              .Editable(editable => editable.DisplayDeleteConfirmation("Are you sure you want to delete this item?"))
              .DataSource(datasource => datasource.Ajax()
                  .Read(read => read.Action("GetWholeSaleLicenseSummaries", "WholesaleLicense", new { permitApplicationId = @Model.HeaderViewModel.PermitApplicationId }))
                  .Destroy(x => x.Action("Delete", "WholesaleLicense", new { permitApplicationId = @Model.HeaderViewModel.PermitApplicationId }))
                  .Model(model => model.Id(x => x.WholesaleLicenseId)))
              .Columns(col =>
              {
                  col.Bound(x => x.WholesaleLicenseId).Hidden();
                  col.Bound(x => x.LicenseNumber);
                  col.Template(@<text></text>)
                      .ClientTemplate("<a class='blue-tableRowIcon glyphicon glyphicon-edit' href='" + Url.Action("Details", new { id = "#= Id #", permitApplicationId = Model.HeaderViewModel.PermitApplicationId }) + "'></a>" + Environment.NewLine
                          + "<div class='k-button-icontext k-grid-delete red-tableRowIcon glyphicon glyphicon-remove' ></div>"
                      )
                      .FooterTemplate("<a class='green-tableRowIcon glyphicon glyphicon-plus' href='" + Url.Action("Details", new { id = Guid.Empty, permitApplicationId = Model.HeaderViewModel.PermitApplicationId }) + "'></a>")
                      .Title("Action")
                      .Width(94);
              }))
    </div>
    @Html.Partial("_NewApplicationProcessFooter", Model)
}

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 03 Aug 2015, 10:21 AM

Hello Christopher,

Unfortunately, I'm not able to re-create such issue using the provided information and code snippets. Maybe there any additional JavaScript logic associated with the Grid. Could you please provide a small runnable sample which exhibits the issue in question. Meanwhile, you should verify that there are no JavaScript errors on the page, as well as that all of the records have unique, non-default ID values. 

Regards,
Rosen
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
Tags
Grid
Asked by
Christopher
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or