jquery 的datatable 怎么用一个按钮代替它的搜索
1个回答
2017-11-01 · 百度知道合伙人官方认证企业
育知同创教育
1【专注:Python+人工智能|Java大数据|HTML5培训】 2【免费提供名师直播课堂、公开课及视频教程】 3【地址:北京市昌平区三旗百汇物美大卖场2层,微信公众号:yuzhitc】
向TA提问
关注
展开全部
//搜索按钮
<div class="container-fluid flu_bot">
<div class="col-md-1 col-sm-1"><button type="button" class="btn btn-primary" id="btnSearch">搜索</button></div>
</div>
//表格
<div class="container-fluid">
<table id="table-javascript"></table>
</div>
//初始化表格js
var TableInit = function () {
var oTableInit = new Object();
oTableInit.queryUrl = '/Official/GetSearchFileList' + '?rnd=' + +Math.random();
//初始化Table
oTableInit.Init = function () {
$('#table-javascript').bootstrapTable({
method: 'get',
url: oTableInit.queryUrl,
height: $(window).height() - 290,
striped: true,
pagination: true,
singleSelect: false,
pageSize: 15,
pageNumber: 1,
pageList: [10, 50, 100, 200, 500],
search: false, //不显示 搜索框
showColumns: false, //不显示下拉框(选择显示的列)
sidePagination: "server", //服务端请求
queryParams: oTableInit.queryParams,
minimunCountColumns: 2,
queryParamsType: "",//分页参数设置
formatNoMatches: function () {
return '未检索到信息';
},
columns: [
{
<div class="container-fluid flu_bot">
<div class="col-md-1 col-sm-1"><button type="button" class="btn btn-primary" id="btnSearch">搜索</button></div>
</div>
//表格
<div class="container-fluid">
<table id="table-javascript"></table>
</div>
//初始化表格js
var TableInit = function () {
var oTableInit = new Object();
oTableInit.queryUrl = '/Official/GetSearchFileList' + '?rnd=' + +Math.random();
//初始化Table
oTableInit.Init = function () {
$('#table-javascript').bootstrapTable({
method: 'get',
url: oTableInit.queryUrl,
height: $(window).height() - 290,
striped: true,
pagination: true,
singleSelect: false,
pageSize: 15,
pageNumber: 1,
pageList: [10, 50, 100, 200, 500],
search: false, //不显示 搜索框
showColumns: false, //不显示下拉框(选择显示的列)
sidePagination: "server", //服务端请求
queryParams: oTableInit.queryParams,
minimunCountColumns: 2,
queryParamsType: "",//分页参数设置
formatNoMatches: function () {
return '未检索到信息';
},
columns: [
{
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询