我想知道你是否可以隐藏,甚至可以起飞上部的田地(显示'n'tikets / Search)?我正在尝试,但每当我更改组件时,页脚也会消失。
下面我粘贴了调用网格的代码摘录。是的,我正在使用插件。
<div id="main-wrapper">
<div class="row">
<div class="col-md-12">
<div class="panel panel-white">
<div class="panel-heading clearfix">
</div>
<div class="panel-body">
<div class="table-responsive">
<table id="example" class="display table" style="width: 100%; cellspacing: 0;">
<thead>
<tr>
<th>
<div>Apelido do Equipamento</div>
<div><input id="input-Default" class="form-control" type="text"/></div>
</th>
<th>
<div>Categoria<br></div>
<div style="margin-bottom: 15px">
<select class="form-control m-b-sm">
<option value="Selecione">Selecione</option>
<option value="Cardio">Cardio</option>
<option value="forca">Força</option>
<option value="Funcional">Funcional</option>
<option value="Ginastica">Ginástica</option>
<option value="Aquatica">Aquática</option>
<option value="Informatica">Informática</option>
<option value="Eletronicas">Eletrônicas</option>
<option value="Outras">Outras</option>
</select></div></th>
<th><div>Equipamento</div><div style="margin-bottom: 15px"><select>
<option value="Selecione">Selecione</option>
<option value="Esteira">Esteira</option>
<option value="Escada">Escada</option>
<option value="Supino">Supino</option>
<option value="Bola">Bola</option>
</select></div></th>
<th><div style="margin-bottom: 10px">Dt. Entrada</div>
<div style="background-color: #f1f1f1; margin-top: 5px;">
<input style="background-color: #f1f1f1; width: 135px;" placeholder="De" type="search"/>
<i class="fa fa-calendar"></i></div>
<div style="background-color: #f1f1f1; margin-top: 5px;">
<input style="background-color: #f1f1f1;
width: 135px;" placeholder="Até" type="search"/>
<i class="fa fa-calendar"></i></div></th>
<th><div style="margin-bottom: 10px">Próxima Manutenção</div>
<div style="background-color: #f1f1f1; margin-top: 5px;">
<input style="background-color: #f1f1f1; width: 135px;" placeholder="De" type="search"/>
<i class="fa fa-calendar"></i></div>
<div style="background-color: #f1f1f1; margin-top: 5px;">
<input style="background-color: #f1f1f1;
width: 135px;" placeholder="Até" type="search"/>
<i class="fa fa-calendar"></i></div></th>
<th><div style="margin-bottom: 25px">Status</div><div></div><div style="margin-bottom: 15px"><select>
<option value="Selecione">Selecione</option>
<option value="Em funcionamento">Em funcionamento</option>
<option value="Em Manutenção">Em Manutenção</option>
<option value="Externo">Externo</option>
<option value="Vendido">Vendido</option>
</select></div></th>
<th>
<div></div>
<div style="margin-top: 5px"><img alt="" style="width: 80px" src="assets/images/BotaoFiltrar.png">
</div>
<div><img alt="" style="width: 80px" src="assets/images/BotaoLimpar.png">
</div>
</th>
</tr>
<tr>
<th>N°. Chamado</th>
<th>Motivo</th>
<th>Área</th>
<th>Equipamento</th>
<th>Dt. Abertura</th>
<th>Dt. Previsão</th>
<th>Dt. Conclusão</th>
<th>Status</th>
</tr>
</thead>
<tfoot>
<tr>
<th>N°. Chamado</th>
<th>Motivo</th>
<th>Área</th>
<th>Equipamento</th>
<th>Dt. Abertura</th>
<th>Dt. Previsão</th>
<th>Dt. Conclusão</th>
<th>Status</th>
</tr>
</tfoot>
<tbody>
<tr>
<td>0000000001</td>
<td>Esteira Quebrada</td>
<td>Aeróbica</td>
<td>EST000001</td>
<td>04/09/2015</td>
<td>10/09/2015</td>
<td>-</td>
<td><span class="label label-warning">Em espera</span></td>
</tr>
<tr>
<td>0000000002</td>
<td>Esteira Quebrada</td>
<td>Aeróbica</td>
<td>EST000004</td>
<td>01/04/2015</td>
<td>30/04/2015</td>
<td>-</td>
<td><span class="label label-warning">Em espera</span></td>
</tr>
<tr>
<td>0000000003</td>
<td>Bicicleta Quebrada</td>
<td>Aeróbica</td>
<td>BIS000020</td>
<td>07/07/2015</td>
<td>01/08/2015</td>
<td>-</td>
<td><span class="label label-warning">Em espera</span></td>
</tr>
<tr>
<td>0000000002</td>
<td>Limpeza de Toilet</td>
<td>Musculação</td>
<td>VST000001</td>
<td>05/09/2015</td>
<td>05/09/2015</td>
<td>05/09/2015</td>
<td><span class="label label-success">Concluído</span></td>
</tr>
<tr>
<td>0000000003</td>
<td>Ergométrica</td>
<td>Aeróbica</td>
<td>BCL000010</td>
<td>02/09/2015</td>
<td>10/09/2015</td>
<td>-</td>
<td><span class="label label-warning">Em Andamento</span></td>
</tr>
<tr>
<td>0000000004</td>
<td>Limpeza de Caixa D'Agua</td>
<td>Predial</td>
<td>CXA0000001</td>
<td>01/09/2015</td>
<td>04/09/2015</td>
<td>-</td>
<td><span class="label label-danger">Atrasado</span></td>
</tr>
<tr>
<td>0000000004</td>
<td>Limpeza de Caixa D'Agua</td>
<td>Predial</td>
<td>CXA0000001</td>
<td>01/09/2015</td>
<td>04/09/2015</td>
<td>-</td>
<td><span class="label label-danger">Atrasado</span></td>
</tr>
<tr>
<td>0000000004</td>
<td>Limpeza de Caixa D'Agua</td>
<td>Predial</td>
<td>CXA0000001</td>
<td>01/09/2015</td>
<td>04/09/2015</td>
<td>-</td>
<td><span class="label label-danger">Atrasado</span></td>
</tr>
<tr>
<td>0000000004</td>
<td>Limpeza de Caixa D'Agua</td>
<td>Predial</td>
<td>CXA0000001</td>
<td>01/09/2015</td>
<td>04/09/2015</td>
<td>-</td>
<td><span class="label label-danger">Atrasado</span></td>
</tr>
<tr>
<td>0000000004</td>
<td>Limpeza de Caixa D'Agua</td>
<td>Predial</td>
<td>CXA0000001</td>
<td>01/09/2015</td>
<td>04/09/2015</td>
<td>-</td>
<td><span class="label label-danger">Atrasado</span></td>
</tr>
<tr>
<td>0000000004</td>
<td>Limpeza de Caixa D'Agua</td>
<td>Predial</td>
<td>CXA0000001</td>
<td>01/09/2015</td>
<td>04/09/2015</td>
<td>-</td>
<td><span class="label label-danger">Atrasado</span></td>
</tr>
<tr>
<td>0000000004</td>
<td>Limpeza de Caixa D'Agua</td>
<td>Predial</td>
<td>CXA0000001</td>
<td>01/09/2015</td>
<td>04/09/2015</td>
<td>-</td>
<td><span class="label label-danger">Atrasado</span></td>
</tr>
<tr>
<td>0000000004</td>
<td>Limpeza de Caixa D'Agua</td>
<td>Predial</td>
<td>CXA0000001</td>
<td>01/09/2015</td>
<td>04/09/2015</td>
<td>-</td>
<td><span class="label label-danger">Atrasado</span></td>
</tr>
<tr>
<td>0000000004</td>
<td>Limpeza de Caixa D'Agua</td>
<td>Predial</td>
<td>CXA0000001</td>
<td>01/09/2015</td>
<td>04/09/2015</td>
<td>-</td>
<td><span class="label label-danger">Atrasado</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div><!-- Row -->
答案 0 :(得分:0)
我假设您的代码和屏幕截图显示您正在使用https://datatables.net插件。
该插件支持多种选项(参见https://datatables.net/reference/option/ )
与您的问题相关的两个选项是
searching
( ref:https://datatables.net/reference/option/searching )lengthChange
( ref:https://datatables.net/reference/option/lengthChange )您应该能够在初始化插件时禁用它们
$('#example').dataTable( {
"searching": false,
"lengthChange": false
} );
或在表格上添加相关属性
<table id="example" data-searching="false" data-length-change="false" class="display table" style="width: 100%; cellspacing: 0;">