Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 添加复选框以允许多个删除&;从我的html表编辑_Javascript_Jquery_Asp.net Mvc_Razor_Asp.net Mvc 5 - Fatal编程技术网

Javascript 添加复选框以允许多个删除&;从我的html表编辑

Javascript 添加复选框以允许多个删除&;从我的html表编辑,javascript,jquery,asp.net-mvc,razor,asp.net-mvc-5,Javascript,Jquery,Asp.net Mvc,Razor,Asp.net Mvc 5,我的asp.net mvc视图中有下表:- @foreach (var item in Model) { <tr id="@item.TMSServerID"> <td> @Html.ActionLink("Edit", "Edit","Server", new { id=item.TMSServerID },null) | @if (!item.IsAlreadyAssigned()){

我的asp.net mvc视图中有下表:-

@foreach (var item in Model) {
    <tr id="@item.TMSServerID">
        <td>
            @Html.ActionLink("Edit", "Edit","Server", new { id=item.TMSServerID },null) |
            @if (!item.IsAlreadyAssigned()){ 

            @Ajax.ActionLink("Delete",
 "Delete", "Server",
new { id = item.TMSServerID },

new AjaxOptions
{ Confirm = "Are You sure You want to delete (" + item.Technology.Tag.ToString() + ")",
    HttpMethod = "Post",

    OnSuccess = "deletionconfirmation",
    OnFailure = "deletionerror"
})}
        </td>

        <td>
             @Html.ActionLink(item.Technology.Tag,"Details","Server",new { id = item.TMSServerID},null)
        </td>

        <td class="hidden-phone" >
            @item.status
        </td>
@foreach(模型中的变量项){
@ActionLink(“编辑”、“编辑”、“服务器”,新的{id=item.TMSServerID},null)|
@如果(!item.IsAlreadyAssigned()){
@ActionLink(“删除”,
“删除”、“服务器”,
新建{id=item.TMSServerID},
新选择
{Confirm=“是否确实要删除(“+item.Technology.Tag.ToString()+”)”,
HttpMethod=“Post”,
OnSuccess=“删除确认”,
OnFailure=“deletionerror”
})}
@ActionLink(item.Technology.Tag,“详细信息”,“服务器”,新的{id=item.TMSServerID},null)
@项目1.状态
该表允许一次编辑、删除单个项目。但现在我要执行以下操作:-

  • 在每行旁边添加一个复选框

  • 添加一个Ajax删除按钮以删除所选项目

  • 添加一个Transfer ajax按钮,该按钮允许编辑所选项目的状态

  • 因此,我正在努力实现以下目标:-

  • 当我需要检查所选项目是否已被其他用户修改时,如何使用ajax按钮传递项目id+项目时间戳字段

  • 如果删除操作成功,如何从html表中删除所选行


  • 谢谢

    在表格的每个第一个单元格上添加一个复选框,每个复选框的值都是ModelID

    在foreach中,包括以下内容:

    <td>
          <input type="checkbox" name="TMSServerID" value="1"  />
    </td>
    
    在按钮事件中,调用控制器方法

    您可能需要查看以下内容以供参考:


    在表格的每个第一个单元格上添加一个复选框,每个复选框的值为ModelID

    在foreach中,包括以下内容:

    <td>
          <input type="checkbox" name="TMSServerID" value="1"  />
    </td>
    
    在按钮事件中,调用控制器方法

    您可能需要查看以下内容以供参考:

    有关此插件的信息,请参阅。有关此插件的信息,请参阅。