双击MVC中gridview中的行事件 [英] Double click event of rows in gridview in MVC
本文介绍了双击MVC中gridview中的行事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
这是我的网格代码
Hi
here is my code for grid
<table id="dynamic-table" class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th>Name</th>
<th>Due Date</th>
<th>Department</th>
<th>Priority</th>
<th>
Action
</th>
</tr>
</thead>
<tbody>
@if (@Model != null)
{
foreach (var item in Model)
{
<tr>
<td>
@item.Name
</td>
<td>@item.DueDate</td>
<td>@item.Department</td>
<td>@ConfigurationHelper.GetItemDescription(BOType, "Priority", item.Priority.ToString())
</td>
<td>
<div class="hidden-sm hidden-xs action-buttons">
<span>
<a class="green" href="@Url.Action("Edit", "Submission", new { id = @item.SubmissionId })">
<i class="ace-icon fa fa-pencil bigger-130"></i>
</a>
<a class="green" href="@Url.Action("Review", "Submission", new { id = @item.SubmissionId })">
<i class="ace-icon fa fa-eye bigger-130 blue"></i>
</a>
</span>
</div>
</td>
</tr>
}
}
</tbody>
</table>
如果在网格中双击行
,我应该如何在另一个视图中打开行数据?
How should i open a row data in the other view up on double click of the row
in grid?
推荐答案
使用Jquery dblclick()功能。
1.设置一个你的tr的课程
Use Jquery dblclick() function.
1. Set a class for your tr
...
<table><tbody><tr class="showInfo">
....
</tr></tbody></table>
2.然后编写代码打开pop up
2. Then write code to open pop up
( 。showInfo)。dblclick( function (){
// 读取您的姓名,截止日期等的最近td值。
// < span class =code-comment>在弹出窗口中将这些设置为您的标签。
// 用所有细节打开你的流行音乐
});
(".showInfo").dblclick(function(){ //Read nearest td value for your Name,Due Date etc. //set these to your label on pop up. //Open your pop with all the details });
祝你好运。
Good luck.
这篇关于双击MVC中gridview中的行事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文