Custom warning about deleting Kendo grid event

I have Kendo Grid

one that has an event Destroy

. I am currently using DisplayDeleteConfirmation

to confirm. But now I want to use my modified jquery ui dialog instead of browser based alert when using event Destroy

. I do not know how to do that. I did google but didn't get it. Can anyone please help?

Below is my kendo grid code:

@(Html.Kendo().Grid<RxConnectEntities.DeleteFaxDTO>().Name("deleteFaxList")
    .Columns(columns =>
    {
            columns.Bound(p => p.DeleteFaxID).Hidden(true);
            columns.Bound(p => p.FaxName).Width(90).Title("Fax File Name");
            columns.Bound(p => p.PerformedDateTimeReadOnly).Width(60).Title("Archive Date").Format("{0:MM/dd/yyyy}");
            columns.Command(command => { command.Destroy().Text("Move to Original"); }).Width(50);
            columns.Bound(p => p.FaxPath).Hidden(true);
    })
    .Editable(editable => editable.Mode(GridEditMode.InLine).DisplayDeleteConfirmation("Are you sure you want to move the highlighted Archived Fax file to the Fax queue?"))
    .Pageable(p => p.PageSizes(true))
    .Sortable()
    .Selectable(selectable => selectable.Mode(GridSelectionMode.Single).Type(GridSelectionType.Row))
    .Events(events => events.Change("onChange").Remove("onRemove"))
    .Groupable()
    .Filterable(f => f.Extra(false).Operators(o => o.ForString(str => str.Clear().StartsWith("Starts with").Contains("Contains")).ForDate(c =>
    {
        c.IsEqualTo("Equal to");
        c.IsGreaterThan("Is after");
    }
    )))
    .DataSource(dataSource => dataSource
        .Ajax().ServerOperation(true)
        .PageSize(20)
        .Model(m => m.Id(p => p.DeleteFaxID))
        .Read(r => r.Action("GetArchiveFaxList", "Fax"))
        .Destroy(d => d.Action("MoveFileFromArchiveToOriginalFax", "Fax"))
    )
)

      

I just want to replace the notification confirmation notification (which is a browser specific warning) with my own jquery ui dialog.

+3


source to share


1 answer


Your difficult question.

I did what you want to do with a custom buttom, for example:

 .Columns(columns =>
        {
            columns.Bound(e => e.FirstName);
            columns.Bound(e => e.LastName);
            columns.Bound(e => e.Title);
            columns.Command(command => command.Custom("MyDelete").Click("myDeleteJs"));
        })

      

where after clicking the "MyDelete" button, the myDeleteJs js function will be launched.



I think this is the only way to do what you need.

Hope this helps.

Regards

0


source







All Articles