【问题标题】:jQuery dataTable additional sortingjQuery dataTable 附加排序
【发布时间】:2015-05-11 09:11:38
【问题描述】:

我使用j_query data_tablesM_V_C 中进行搜索,并且希望能够使用表格外的按钮对表格进行排序。并想按专业排序。我该怎么做?

【问题讨论】:

  • 你试过了吗?如果有,请显示一些代码

标签: sorting model-view-controller jquery-datatables


【解决方案1】:

我在按钮中使用了 Ajax.ActionLink:

<pre>

    <div class="personal_types">
        @*<button type="button" class="btn btn-default active">All</button>*@
        @Ajax.ActionLink(
        "All",
        "AllStaff",
        "Staff",
        new AjaxOptions { UpdateTargetId = "result" },
                        new { @class = "btn btn-default default" }
    )

        @Ajax.ActionLink(
        "Managers",
        "StaffPosition",
        "Staff",
        new { id = 2 },
        new AjaxOptions { UpdateTargetId = "result" },
                new { @class = "btn btn-default default" }
    )
    </div>

<div id="result">


    <div class="manage_list">
        <table class="table table-hover" id="_staff">
            <thead>
                <tr>
                    <th width="5%">Code</th>
                    <th width="24%">Full Name</th>
                    <th width="15%">Position</th>

                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model)
                {
                    <tr>
                        <th scope="row">@item.user_id</th>
                        <td>@item.full_name</td>
                        <td>@item.group_name_geo</td>
                        <td>@item.shop_name</td>
                        <td>@item.reg_date</td>

                    </tr>
                }
            </tbody>
        </table>
    </div>


</div>

</pre>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-30
    • 2013-07-22
    • 2016-11-30
    • 1970-01-01
    • 2014-08-30
    相关资源
    最近更新 更多