扩展过滤器控件,不设置搜索字段

时间:2018-09-05 13:03:16

标签: jquery twitter-bootstrap plugins bootstrap-table

我添加了filter-control扩展名。 我的网格配置如下。

由于数据来自服务器,因此data-query-params="parametrosDaConsulta"的配置如下:

function parametrosDaConsulta(params) {

    console.log(params);

    return {
        filtroCampos: params.filter,
        itensPorPagina: params.limit,
        itensParaIgnorar: params.offset,
        filtro: params.search,
        orderna: params.sort,
        ordernaTipo: params.order,
        tipoPesquisa: $(this).attr("tipopesquisa"),
        registroPaiID: $("#" + $(this).attr("registropaiid")).val()
    }; 
};

我的问题是,在过滤列时,插件正确发送了"field": "value"数据过滤器参数。

但是在搜索参数中,将发送字段值的值。

我的问题

如何使过滤器控制插件不设置搜索值?

我的表配置

<table id="table"
       data-toggle="table"
       data-url="/Ajax/Grid/"
       data-side-pagination="server"
       data-pagination="true"
       data-page-list="[5, 10, 20, 50, 100, 200, 500]"
       data-search="true"
       data-filter-control="true"
       data-show-refresh="true"
       data-show-toggle="true"
       data-show-columns="true"
       data-query-params="parametrosDaConsulta"
       data-locale="pt-BR"
       data-search-on-enter-key="true"
       data-row-style="estiloDaLinha"
       data-toolbar="#exportarGrid"
       data-tipopesquisa="OperacaoPlanoLocalidade">
    <thead>
        <tr>
            <th data-field="OperacaoPlanoLocalidadeID" data-sortable="true" data-visible="false" data-width="96px">ID</th>
            <th data-field="Nome" data-width="288px" data-sortable="true" data-filter-control="select" data-filter-data="var:clientes" data-search-on-enter-key="true">Cliente</th>
            <th data-field="Plano" data-sortable="true">Plano</th>
            <th data-field="Localidade" data-sortable="true">Localidade</th>
            @Html.Partial(@MTSys.Lib.Constantes.gridPadraoCamposFixos)
            <th data-field="botoes" data-width="48px" data-registroid="OperacaoPlanoLocalidadeID" data-controller="OperacaoPlanoLocalidade" data-formatter="adicionarBotaoEdicao" data-niveldeacesso="@nivelDeAcesso"></th>
        </tr>
    </thead>
</table>

0 个答案:

没有答案