Bootstrap表过滤器不起作用

时间:2018-08-06 20:40:53

标签: jquery html twitter-bootstrap

     <table id="bootstrap-table" class="table table-striped">
                            <thead>
                            <th data-field="checkbox" data-checkbox="true"></th>
                            <th data-field="action" data-formatter="actionFormatter" data-events="actionEvents">Action</th>
                            <th data-field="FileName" data-filter-control="select" data-sortable="true">
                                @Html.DisplayNameFor(model => model.RepublishFiles.FirstOrDefault().FileName)
                            </th>
                            @*<th data-field="Payer" data-sortable="true">
                                   @Html.DisplayNameFor(model => model.RepublishFiles.FirstOrDefault().Payer)
                                </th>
                                <th data-field="Entity" data-sortable="true">
                                   @Html.DisplayNameFor(model => model.RepublishFiles.FirstOrDefault().Entity)
                                </th>
                                <th data-field="Submitting_Payer" data-sortable="true">
                                  @Html.DisplayNameFor(model => model.RepublishFiles.FirstOrDefault().Submitting_Payer)
                                </th>*@
                            <th data-field="F_Type" data-filter-control="select" data-sortable="true">
                                @Html.DisplayNameFor(model => model.RepublishFiles.FirstOrDefault().F_Type)
                            </th>
                            <th data-field="DSGVersion" data-filter-control="select" data-sortable="true">
                                @Html.DisplayNameFor(model => model.RepublishFiles.FirstOrDefault().DSGVersion)
                            </th>
                            <th data-field="C_Gap" data-filter-control="select" data-sortable="true">
                                @Html.DisplayNameFor(model => model.RepublishFiles.FirstOrDefault().C_Gap)
                            </th>
                            <th data-field="Coverage" data-filter-control="select" data-sortable="true">
                                @Html.DisplayNameFor(model => model.RepublishFiles.FirstOrDefault().Coverage)
                            </th>
                            <th data-field="F_Stat_Description" data-filter-control="select" data-sortable="true">
                                @Html.DisplayNameFor(model => model.RepublishFiles.FirstOrDefault().F_Stat_Description)
                            </th>
                            <th data-field="DV_Result" data-filter-control="select" data-sortable="true">
                                @Html.DisplayNameFor(model => model.RepublishFiles.FirstOrDefault().DV_Result)
                            </th>
                            <th data-field="DV_Status" data-filter-control="select" data-sortable="true">
                                @Html.DisplayNameFor(model => model.RepublishFiles.FirstOrDefault().DV_Status)
                            </th>
                            <th data-field="F_ID" data-filter-control="select" data-sortable="true">
                                @Html.DisplayNameFor(model => model.RepublishFiles.FirstOrDefault().F_ID)
                            </th>
                            <th data-field="SESubmitdate" data-filter-control="select" data-sortable="true">
                                @Html.DisplayNameFor(model => model.RepublishFiles.FirstOrDefault().SESubmitdate)
                            </th>
                            <th data-field="FileLogDate" data-filter-control="select" data-sortable="true">
                                @Html.DisplayNameFor(model => model.RepublishFiles.FirstOrDefault().FileLogDate)
                            </th>
                            <th data-field="ParentFileLogID" data-filter-control="select" data-sortable="true">
                                @Html.DisplayNameFor(model => model.RepublishFiles.FirstOrDefault().ParentFileLogID)
                            </th>
                            <th data-field="ReRunDate" data-filter-control="select" data-sortable="true">
                                @Html.DisplayNameFor(model => model.RepublishFiles.FirstOrDefault().ReRunDate)
                            </th>

                            </thead>

                            <tbody id="tableBody">
                                @foreach (var item in Model.RepublishFiles)
                                {
                                    <tr>
                                        <td class="bs-checkbox"><input data-index="4" name="btSelectItem" type="checkbox"></td>
                                        <td>
                                            <a rel="tooltip" title="RePublish" class="btn btn-simple btn-danger btn-icon table-action"
                                               href=@Url.Action("republishFile()", new {payer_abbr = "\"" + Model.PayerAbbr + "\"", entity_code = "\"" + Model.EntityCode + "\"", fileName = "\"" + item.FileName + "\""})><i class="fa fa-repeat"></i></a>
                                        </td>
                                        <td>
                                            @Html.DisplayFor(modelItem => item.FileName)
                                        </td>
                                        @*<td>
                                             @Html.DisplayFor(modelitem => item.Payer,  new { htmlattributes = new { @style = "display:none" } })
                                            </td>
                                             <td>
                                             @Html.DisplayFor(modelitem => item.Entity, new { htmlattributes = new { @style = "display:none" } })
                                             </td>
                                                <td>
                                             @Html.DisplayFor(modelitem => item.Submitting_Payer, new { htmlattributes = new { @style = "display:none" } })
                                             </td>*@
                                        <td>
                                            @Html.DisplayFor(modelItem => item.F_Type)
                                        </td>
                                        <td>
                                            @Html.DisplayFor(modelItem => item.DSGVersion)
                                        </td>
                                        <td>
                                            @Html.DisplayFor(modelItem => item.C_Gap)
                                        </td>
                                        <td>
                                            @Html.DisplayFor(modelItem => item.Coverage)
                                        </td>
                                        <td>
                                            @Html.DisplayFor(modelItem => item.F_Stat_Description)
                                        </td>
                                        <td>
                                            @Html.DisplayFor(modelItem => item.DV_Result)
                                        </td>
                                        <td>
                                            @Html.DisplayFor(modelItem => item.DV_Status)
                                        </td>
                                        <td>
                                            @Html.DisplayFor(modelItem => item.F_ID)
                                        </td>
                                        <td>
                                            @Html.DisplayFor(modelItem => item.SESubmitdate)
                                        </td>
                                        <td>
                                            @Html.DisplayFor(modelItem => item.FileLogDate)
                                        </td>
                                        <td>
                                            @Html.DisplayFor(modelItem => item.ParentFileLogID)
                                        </td>
                                        <td>
                                            @Html.DisplayFor(modelItem => item.ReRunDate)
                                        </td>
                                    </tr>
                                }
                            </tbody>
                        </table>

我使用引导表。我想使用表格过滤器扩展,但过滤器未初始化。

->脚本:https://codepen.io/AurelieT/pen/JGxMgo ->需要这样的过滤器.....但是它没有按预期工作 我使用引导表。我想使用表格过滤器扩展,但过滤器未初始化。

  //initialize bootstrap table
        var $table = $('#bootstrap-table');

        $table.bootstrapTable({


            toolbar: ".toolbar",
            clickToSelect: false,
            showRefresh: false,
            showFilter: true,
            search: true,
            showToggle: true,
            showColumns: true,
            pagination: true,
            searchAlign: 'right',
            pageSize: 8,
            pageList: [10, 25, 50, 100, 200, 300, 400, 500, 1000],
            formatShowingRows: function (pageFrom, pageTo, totalRows) {
                //do nothing here, we don't want to show the text "showing x of y from..."
            },
            formatNoMatches: function () {
                $('#lblSubmittingPayer').hide();
                $('#txtSubmittingPayer').hide();
                return 'No matching records found';
            },
            formatRecordsPerPage: function (pageNumber) {
                return pageNumber + " rows visible";
            },
            icons: {
                refresh: 'fa fa-refresh',
                toggle: 'fa fa-th-list',
                columns: 'fa fa-columns',
                detailOpen: 'fa fa-plus-circle',
                detailClose: 'ti-close'
            }
        });

0 个答案:

没有答案