mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-10 15:14:33 +08:00
removes datatables.noSearchHidden plugin
This commit is contained in:
parent
2766b7aaff
commit
8a99d35a8d
4 changed files with 0 additions and 61 deletions
|
@ -30,7 +30,6 @@
|
||||||
//= require tinymce-jquery
|
//= require tinymce-jquery
|
||||||
//= require jsPlumb-2.0.4-min
|
//= require jsPlumb-2.0.4-min
|
||||||
//= require jsnetworkx
|
//= require jsnetworkx
|
||||||
//= require dataTables.noSearchHidden
|
|
||||||
//= require bootstrap-select
|
//= require bootstrap-select
|
||||||
//= require_directory ./sitewide
|
//= require_directory ./sitewide
|
||||||
//= require jquery.dataTables.yadcf
|
//= require jquery.dataTables.yadcf
|
||||||
|
|
|
@ -245,9 +245,6 @@ var RepositoryDatatable = (function(global) {
|
||||||
return TABLE;
|
return TABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enables noSearchHidden plugin
|
|
||||||
$.fn.dataTable.defaults.noSearchHidden = true;
|
|
||||||
|
|
||||||
function bindExportActions() {
|
function bindExportActions() {
|
||||||
$('form#form-export').submit(function() {
|
$('form#form-export').submit(function() {
|
||||||
var form = this;
|
var form = this;
|
||||||
|
|
|
@ -271,10 +271,6 @@ setTimeout(function () {
|
||||||
table.columns.adjust();
|
table.columns.adjust();
|
||||||
}, 10);
|
}, 10);
|
||||||
|
|
||||||
|
|
||||||
// Enables noSearchHidden plugin
|
|
||||||
$.fn.dataTable.defaults.noSearchHidden = true;
|
|
||||||
|
|
||||||
// Updates "Select all" control in a data table
|
// Updates "Select all" control in a data table
|
||||||
function updateDataTableSelectAllCtrl(table) {
|
function updateDataTableSelectAllCtrl(table) {
|
||||||
var $table = table.table().node();
|
var $table = table.table().node();
|
||||||
|
|
|
@ -1,53 +0,0 @@
|
||||||
/**
|
|
||||||
* @summary NoSearchHidden
|
|
||||||
* @description Prevent searching of cells in hidden columns in DataTables
|
|
||||||
* @version 1.0.0
|
|
||||||
* @file dataTables.noSearchHidden.js
|
|
||||||
* @author Brian White
|
|
||||||
* @contact github.com/mscdex/dataTables.noSearchHidden
|
|
||||||
* @copyright Copyright 2014 Brian White
|
|
||||||
*
|
|
||||||
* License MIT - http://opensource.org/licenses/MIT
|
|
||||||
*
|
|
||||||
* This feature plug-in for DataTables will prevent searching of cells located
|
|
||||||
* in hidden columns. This behavior is dynamic, so as column visibility
|
|
||||||
* changes, so does the search cache.
|
|
||||||
*
|
|
||||||
* This feature can be enabled by:
|
|
||||||
*
|
|
||||||
* * Setting the `noSearchHidden` parameter in the DataTables initialization to
|
|
||||||
* be true
|
|
||||||
* * Setting the `noSearchHidden` parameter to be true in the DataTables
|
|
||||||
* defaults (thus causing all tables to have this feature) - i.e.
|
|
||||||
* `$.fn.dataTable.defaults.noSearchHidden = true`.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
(function(window, document, $) {
|
|
||||||
// Listen for DataTables initializations
|
|
||||||
$(document).on('init.dt.dth', function(e, settings, json) {
|
|
||||||
//console.log("out");
|
|
||||||
// prevents colision with the slick slider
|
|
||||||
if( settings.hasOwnProperty('unslicked') ) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
|
||||||
settings.oInit.noSearchHidden || // option specified
|
|
||||||
$.fn.dataTable.defaults.noSearchHidden // default set
|
|
||||||
) {
|
|
||||||
//console.log("in");
|
|
||||||
var table = new $.fn.dataTable.Api(settings),
|
|
||||||
aoColumns = table.settings()[0].aoColumns;
|
|
||||||
//console.log(table);
|
|
||||||
table.on('column-visibility.dt.dth', function(e, settings, column, state) {
|
|
||||||
var col = aoColumns[column];
|
|
||||||
col.searchable = col.bSearchable = state;
|
|
||||||
table.rows().invalidate();
|
|
||||||
}).on('destroy', function() {
|
|
||||||
// Remove event handler
|
|
||||||
table.off('column-visibility.dt.dth');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})(window, document, jQuery);
|
|
Loading…
Add table
Reference in a new issue