在jqgrid的每一行中编辑按钮 [英] Edit button in each row of jqgrid

查看:104
本文介绍了在jqgrid的每一行中编辑按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何在jqgrid的每一行中创建一个编辑按钮。



例子



s.no name city address编辑



1 xxx xxx xxxx编辑



2 yyy yy yyy编辑



3 zzz zzz zzz编辑











怎么办?如何为这个Edit事件编写代码?



提前谢谢

Hi,
how to make a edit button in each row of jqgrid.

example

s.no name city address Edit

1 xxx xxx xxxx Edit

2 yyy yy yyy Edit

3 zzz zzz zzz Edit
.
.
.
.

how to do this? how to write code for this Edit event?

Thanks in advance

推荐答案

使用自定义格式化程序如下



Use custom formatter like below

{ name: 'Edit',
                             formatter: function (cellvalue, options, rowObject) {
                                 var cellId = rowObject[0];//specify the index for getting the cell value

                              var x = '@Html.ActionLink("Edit", "Edit", "ControllerName", new { requestId = "myId" }, new { @style = "color:Blue;font-weight:bold;" })';
                                 return x.replace("myId",cellId);
                                 }
                             },sortable:false, align: 'left', width: 50
                         },





你的ActionResult





Your ActionResult

public ActionResult Edit(int requestId)
{
return View();
}





希望这有帮助



Hope this helps


这篇关于在jqgrid的每一行中编辑按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆