This question is locked. New answers and comments are not allowed.
Hi there,
I'm trying to delete a row on the client side.
following is my grid, I have a custom command that is used to trigger a javascript function, where I will get the key, then loop through data of the grid and try to remove that from the grid.
The problem is that I don't know how to pass the RecipientId to the javascript function. Could you give me an example?
this is my javascript
regards
Jerry Ren
I'm trying to delete a row on the client side.
following is my grid, I have a custom command that is used to trigger a javascript function, where I will get the key, then loop through data of the grid and try to remove that from the grid.
The problem is that I don't know how to pass the RecipientId to the javascript function. Could you give me an example?
@(Html.Telerik().Grid((IEnumerable<
Alpaca.Website.FleetManagement.Models.RecipientModel
>)ViewData["Recipient"])
.Name("RecipientGrid")
.DataKeys(keys => keys.Add(c => c.RecipientId))
.Columns(col =>
{
col.Bound(o => o.RecipientType).Width(100);
col.Bound(o => o.IsNotifySMS).Width(100);
col.Bound(o => o.IsNotifyEmail).Width(100);
col.Command(commands =>
{
commands.Custom("DeleteRecipient").Text("Delete").HtmlAttributes(new { onclick = "DeleteRecipient();return false;" });
}).Width(200);
})
.Sortable()
.Groupable()
.Filterable())
this is my javascript
function DeleteRecipient( eventArgs){
alert(eventArgs);
}
regards
Jerry Ren