开发者

Telerik Grid. How to tell which button is clicked on on OnDelete() client action?

In Telerik Grid, how to tell which button is clicked on when OnDelete() client action is triggered? Or is there any pre or post action for OnDelete()?

I want to implement some 开发者_JS百科custom logic which only be triggered when the user hits on OK button in the confirmation dialog.

Thanks in advance!


Currently not. What you can do is bind your own click handler to the delete button during the OnRowDataBound event:

function onRowDataBound(e) {
    $(e.row).find(".t-grid-delete").click(function(e) {

    });
}


Maybe I'm misunderstanding the question but the DeleteConfirmed is triggered after the user "confirms" the delete. This logic handles the first "GridDelete" and the "DeleteConfirmed".

  [HttpPost, ActionName("GridDelete")]
  [GridAction]
  public ActionResult DeleteConfirmed(int id)
  {
      lm_r_category category = db.lm_r_category.Single(l => l.cat_id == id);
      db.lm_r_category.DeleteObject(category);
      db.SaveChanges();
      return View(new GridModel(db.lm_r_category));
  }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜