我添加了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>