/pack-rat/003_pack_rat/pack-rat/node_modules/bootstrap-table/docs/dist/extensions/filter/bootstrap-table-filter.js |
@@ -0,0 +1,67 @@ |
/** |
* @author zhixin wen <wenzhixin2010@gmail.com> |
* extensions: https://github.com/lukaskral/bootstrap-table-filter |
*/ |
|
!function($) { |
|
'use strict'; |
|
$.extend($.fn.bootstrapTable.defaults, { |
showFilter: false |
}); |
|
var BootstrapTable = $.fn.bootstrapTable.Constructor, |
_init = BootstrapTable.prototype.init, |
_initSearch = BootstrapTable.prototype.initSearch; |
|
BootstrapTable.prototype.init = function () { |
_init.apply(this, Array.prototype.slice.apply(arguments)); |
|
var that = this; |
this.$el.on('load-success.bs.table', function () { |
if (that.options.showFilter) { |
$(that.options.toolbar).bootstrapTableFilter({ |
connectTo: that.$el |
}); |
} |
}); |
}; |
|
BootstrapTable.prototype.initSearch = function () { |
_initSearch.apply(this, Array.prototype.slice.apply(arguments)); |
|
if (this.options.sidePagination !== 'server') { |
if (typeof this.searchCallback === 'function') { |
this.data = $.grep(this.options.data, this.searchCallback); |
} |
} |
}; |
|
BootstrapTable.prototype.getData = function () { |
return (this.searchText || this.searchCallback) ? this.data : this.options.data; |
}; |
|
BootstrapTable.prototype.getColumns = function () { |
return this.columns; |
}; |
|
BootstrapTable.prototype.registerSearchCallback = function (callback) { |
this.searchCallback = callback; |
}; |
|
BootstrapTable.prototype.updateSearch = function () { |
this.options.pageNumber = 1; |
this.initSearch(); |
this.updatePagination(); |
}; |
|
BootstrapTable.prototype.getServerUrl = function () { |
return (this.options.sidePagination === 'server') ? this.options.url : false; |
}; |
|
$.fn.bootstrapTable.methods.push('getColumns', |
'registerSearchCallback', 'updateSearch', |
'getServerUrl'); |
|
}(jQuery); |
/pack-rat/003_pack_rat/pack-rat/node_modules/bootstrap-table/docs/dist/extensions/filter/bootstrap-table-filter.min.js |
@@ -0,0 +1,7 @@ |
/* |
* bootstrap-table - v1.11.1 - 2017-02-22 |
* https://github.com/wenzhixin/bootstrap-table |
* Copyright (c) 2017 zhixin wen |
* Licensed MIT License |
*/ |
!function(a){"use strict";a.extend(a.fn.bootstrapTable.defaults,{showFilter:!1});var b=a.fn.bootstrapTable.Constructor,c=b.prototype.init,d=b.prototype.initSearch;b.prototype.init=function(){c.apply(this,Array.prototype.slice.apply(arguments));var b=this;this.$el.on("load-success.bs.table",function(){b.options.showFilter&&a(b.options.toolbar).bootstrapTableFilter({connectTo:b.$el})})},b.prototype.initSearch=function(){d.apply(this,Array.prototype.slice.apply(arguments)),"server"!==this.options.sidePagination&&"function"==typeof this.searchCallback&&(this.data=a.grep(this.options.data,this.searchCallback))},b.prototype.getData=function(){return this.searchText||this.searchCallback?this.data:this.options.data},b.prototype.getColumns=function(){return this.columns},b.prototype.registerSearchCallback=function(a){this.searchCallback=a},b.prototype.updateSearch=function(){this.options.pageNumber=1,this.initSearch(),this.updatePagination()},b.prototype.getServerUrl=function(){return"server"===this.options.sidePagination?this.options.url:!1},a.fn.bootstrapTable.methods.push("getColumns","registerSearchCallback","updateSearch","getServerUrl")}(jQuery); |