Features: Updates to operate with DataTables 2

pull/583/head
Allan Jardine 7 months ago
parent 0ad891685f
commit 6c9c2abac0

@ -1,15 +1,16 @@
/*! © SpryMedia Ltd - datatables.net/license */
interface AlphabetSearchOptions {
column?: number;
caseSensitive?: boolean;
numbers?: boolean;
}
declare module 'datatables.net' {
interface DataTablesStatic {
/** Show an set of alphabet buttons alongside a table providing search input options */
AlphabetSearch(settings: any): void;
}
interface Config {
alphabet?: {
column: number;
caseSensitive: boolean;
numbers: boolean;
};
alphabet?: AlphabetSearchOptions;
}
interface Api<T> {
alphabetSearch: ApiAlphabet<T>;
@ -21,5 +22,8 @@ declare module 'datatables.net' {
node(): JQuery | null;
recalc(): Api<T>;
}
interface Feature {
alphabetSearch?: AlphabetSearchOptions;
}
}
export {};

@ -58,9 +58,16 @@ var DataTable = $.fn.dataTable;
*
* License MIT - http://datatables.net/license/mit
*
* For more detailed information please see:
* http://datatables.net/blog/2014-09-22
* Please see [this blog post](http://datatables.net/blog/2014-09-22).
*
* @example
* $('#myTable').DataTable( {
* layout: {
* topStart: 'alphabetSearch;
* }
* } );
*/
;
// Search function
DataTable.Api.register('alphabetSearch()', function (searchTerm) {
this.iterator('table', function (context) {
@ -217,6 +224,10 @@ DataTable.ext.feature.push({
},
cFeature: 'A',
});
DataTable.feature.register('alphabetSearch', function (settings, opts) {
var search = new DataTable.AlphabetSearch(settings);
return search.node();
});
return DataTable;

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */
!function(a){var n,i;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(t){return a(t,window,document)}):"object"==typeof exports?(n=require("jquery"),i=function(t,e){e.fn.dataTable||require("datatables.net")(t,e)},"undefined"==typeof window?module.exports=function(t,e){return t=t||window,e=e||n(t),i(t,e),a(e,0,t.document)}:(i(window,n),module.exports=a(n,window,window.document))):a(jQuery,window,document)}(function(o,t,e,i){"use strict";var r=o.fn.dataTable;function c(t,e,a){e.empty(),e.append("Search: ");var t=t.column(a.column).data(),n=function(t,e){for(var a,n={},i=0,r=t.length;i<r;i++)n[a=e.caseSensitive?t[i].toString().replace(/<.*?>/g,"").charAt(0):t[i].toString().replace(/<.*?>/g,"").charAt(0).toUpperCase()]?n[a]++:n[a]=1;return n}(t,a);if(o('<span class="clear active"/>').data("letter","").data("match-count",t.length).html("None").appendTo(e),a.numbers)for(var i=0;i<10;i++){var r=String.fromCharCode(48+i);o("<span/>").data("letter",r).data("match-count",n[r]||0).addClass(n[r]?"":"empty").html(r).appendTo(e)}for(i=0;i<26;i++){r=String.fromCharCode(65+i);o("<span/>").data("letter",r).data("match-count",n[r]||0).addClass(n[r]?"":"empty").html(r).appendTo(e)}if(a.caseSensitive)for(i=0;i<26;i++){r=String.fromCharCode(97+i);o("<span/>").data("letter",r).data("match-count",n[r]||0).addClass(n[r]?"":"empty").html(r).appendTo(e)}o('<div class="alphabetInfo"></div>').appendTo(e)}return r.Api.register("alphabetSearch()",function(e){return this.iterator("table",function(t){t.alphabetSearch=e}),this}),r.Api.register("alphabetSearch.recalc()",function(){return this.iterator("table",function(t){c(new r.Api(t),t._alphabet,t._alphabetOptions)}),this}),r.Api.register("alphabetSearch.node()",function(){return this._context.length?this._context._alphabet:null}),r.ext.search.push(function(t,e){if(!t.alphabetSearch)return!0;var a=0,n=!1;if(t.oInit.alphabet!==i&&(a=t.oInit.alphabet.column!==i?t.oInit.alphabet.column:0,n=t.oInit.alphabet.caseSensitive!==i&&t.oInit.alphabet.caseSensitive),n){if(e[a].charAt(0)===t.alphabetSearch)return!0}else if(e[a].charAt(0).toUpperCase()===t.alphabetSearch)return!0;return!1}),r.AlphabetSearch=function(t){var e=new r.Api(t),a=o('<div class="alphabet"/>'),n=o.extend({column:0,caseSensitive:!1,numbers:!1},e.init().alphabet);c(e,a,n),t._alphabet=a,t._alphabetOptions=n,a.on("click","span",function(){a.find(".active").removeClass("active"),o(this).addClass("active"),e.alphabetSearch(o(this).data("letter")).draw()}),a.on("mouseenter","span",function(){a.find("div.alphabetInfo").css({opacity:1,left:o(this).position().left,width:o(this).width()}).html(o(this).data("match-count"))}).on("mouseleave","span",function(){a.find("div.alphabetInfo").css("opacity",0)}),this.node=function(){return a}},r.ext.feature.push({fnInit:function(t){return new r.AlphabetSearch(t).node()},cFeature:"A"}),r});
!function(a){var n,i;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(t){return a(t,window,document)}):"object"==typeof exports?(n=require("jquery"),i=function(t,e){e.fn.dataTable||require("datatables.net")(t,e)},"undefined"==typeof window?module.exports=function(t,e){return t=t||window,e=e||n(t),i(t,e),a(e,0,t.document)}:(i(window,n),module.exports=a(n,window,window.document))):a(jQuery,window,document)}(function(o,t,e){"use strict";var i=o.fn.dataTable;function r(t,e,a){e.empty(),e.append("Search: ");var t=t.column(a.column).data(),n=function(t,e){for(var a,n={},i=0,r=t.length;i<r;i++)n[a=e.caseSensitive?t[i].toString().replace(/<.*?>/g,"").charAt(0):t[i].toString().replace(/<.*?>/g,"").charAt(0).toUpperCase()]?n[a]++:n[a]=1;return n}(t,a);if(o('<span class="clear active"/>').data("letter","").data("match-count",t.length).html("None").appendTo(e),a.numbers)for(var i=0;i<10;i++){var r=String.fromCharCode(48+i);o("<span/>").data("letter",r).data("match-count",n[r]||0).addClass(n[r]?"":"empty").html(r).appendTo(e)}for(i=0;i<26;i++){r=String.fromCharCode(65+i);o("<span/>").data("letter",r).data("match-count",n[r]||0).addClass(n[r]?"":"empty").html(r).appendTo(e)}if(a.caseSensitive)for(i=0;i<26;i++){r=String.fromCharCode(97+i);o("<span/>").data("letter",r).data("match-count",n[r]||0).addClass(n[r]?"":"empty").html(r).appendTo(e)}o('<div class="alphabetInfo"></div>').appendTo(e)}return i.Api.register("alphabetSearch()",function(e){return this.iterator("table",function(t){t.alphabetSearch=e}),this}),i.Api.register("alphabetSearch.recalc()",function(){return this.iterator("table",function(t){r(new i.Api(t),t._alphabet,t._alphabetOptions)}),this}),i.Api.register("alphabetSearch.node()",function(){return this._context.length?this._context._alphabet:null}),i.ext.search.push(function(t,e){if(!t.alphabetSearch)return!0;var a=0,n=!1;if(void 0!==t.oInit.alphabet&&(a=void 0!==t.oInit.alphabet.column?t.oInit.alphabet.column:0,n=void 0!==t.oInit.alphabet.caseSensitive&&t.oInit.alphabet.caseSensitive),n){if(e[a].charAt(0)===t.alphabetSearch)return!0}else if(e[a].charAt(0).toUpperCase()===t.alphabetSearch)return!0;return!1}),i.AlphabetSearch=function(t){var e=new i.Api(t),a=o('<div class="alphabet"/>'),n=o.extend({column:0,caseSensitive:!1,numbers:!1},e.init().alphabet);r(e,a,n),t._alphabet=a,t._alphabetOptions=n,a.on("click","span",function(){a.find(".active").removeClass("active"),o(this).addClass("active"),e.alphabetSearch(o(this).data("letter")).draw()}),a.on("mouseenter","span",function(){a.find("div.alphabetInfo").css({opacity:1,left:o(this).position().left,width:o(this).width()}).html(o(this).data("match-count"))}).on("mouseleave","span",function(){a.find("div.alphabetInfo").css("opacity",0)}),this.node=function(){return a}},i.ext.feature.push({fnInit:function(t){return new i.AlphabetSearch(t).node()},cFeature:"A"}),i.feature.register("alphabetSearch",function(t,e){return new i.AlphabetSearch(t).node()}),i});

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */
import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;function bin(a,t){for(var e,n={},r=0,i=a.length;r<i;r++)n[e=t.caseSensitive?a[r].toString().replace(/<.*?>/g,"").charAt(0):a[r].toString().replace(/<.*?>/g,"").charAt(0).toUpperCase()]?n[e]++:n[e]=1;return n}function draw(a,t,e){t.empty(),t.append("Search: ");var a=a.column(e.column).data(),n=bin(a,e);if($('<span class="clear active"/>').data("letter","").data("match-count",a.length).html("None").appendTo(t),e.numbers)for(var r=0;r<10;r++){var i=String.fromCharCode(48+r);$("<span/>").data("letter",i).data("match-count",n[i]||0).addClass(n[i]?"":"empty").html(i).appendTo(t)}for(r=0;r<26;r++){i=String.fromCharCode(65+r);$("<span/>").data("letter",i).data("match-count",n[i]||0).addClass(n[i]?"":"empty").html(i).appendTo(t)}if(e.caseSensitive)for(r=0;r<26;r++){i=String.fromCharCode(97+r);$("<span/>").data("letter",i).data("match-count",n[i]||0).addClass(n[i]?"":"empty").html(i).appendTo(t)}$('<div class="alphabetInfo"></div>').appendTo(t)}DataTable.Api.register("alphabetSearch()",function(t){return this.iterator("table",function(a){a.alphabetSearch=t}),this}),DataTable.Api.register("alphabetSearch.recalc()",function(){return this.iterator("table",function(a){draw(new DataTable.Api(a),a._alphabet,a._alphabetOptions)}),this}),DataTable.Api.register("alphabetSearch.node()",function(){return this._context.length?this._context._alphabet:null}),DataTable.ext.search.push(function(a,t){if(!a.alphabetSearch)return!0;var e=0,n=!1;if(void 0!==a.oInit.alphabet&&(e=void 0!==a.oInit.alphabet.column?a.oInit.alphabet.column:0,n=void 0!==a.oInit.alphabet.caseSensitive&&a.oInit.alphabet.caseSensitive),n){if(t[e].charAt(0)===a.alphabetSearch)return!0}else if(t[e].charAt(0).toUpperCase()===a.alphabetSearch)return!0;return!1}),DataTable.AlphabetSearch=function(a){var t=new DataTable.Api(a),e=$('<div class="alphabet"/>'),n=$.extend({column:0,caseSensitive:!1,numbers:!1},t.init().alphabet);draw(t,e,n),a._alphabet=e,a._alphabetOptions=n,e.on("click","span",function(){e.find(".active").removeClass("active"),$(this).addClass("active"),t.alphabetSearch($(this).data("letter")).draw()}),e.on("mouseenter","span",function(){e.find("div.alphabetInfo").css({opacity:1,left:$(this).position().left,width:$(this).width()}).html($(this).data("match-count"))}).on("mouseleave","span",function(){e.find("div.alphabetInfo").css("opacity",0)}),this.node=function(){return e}},DataTable.ext.feature.push({fnInit:function(a){return new DataTable.AlphabetSearch(a).node()},cFeature:"A"});export default DataTable;
import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;function bin(a,t){for(var e,n={},r=0,i=a.length;r<i;r++)n[e=t.caseSensitive?a[r].toString().replace(/<.*?>/g,"").charAt(0):a[r].toString().replace(/<.*?>/g,"").charAt(0).toUpperCase()]?n[e]++:n[e]=1;return n}function draw(a,t,e){t.empty(),t.append("Search: ");var a=a.column(e.column).data(),n=bin(a,e);if($('<span class="clear active"/>').data("letter","").data("match-count",a.length).html("None").appendTo(t),e.numbers)for(var r=0;r<10;r++){var i=String.fromCharCode(48+r);$("<span/>").data("letter",i).data("match-count",n[i]||0).addClass(n[i]?"":"empty").html(i).appendTo(t)}for(r=0;r<26;r++){i=String.fromCharCode(65+r);$("<span/>").data("letter",i).data("match-count",n[i]||0).addClass(n[i]?"":"empty").html(i).appendTo(t)}if(e.caseSensitive)for(r=0;r<26;r++){i=String.fromCharCode(97+r);$("<span/>").data("letter",i).data("match-count",n[i]||0).addClass(n[i]?"":"empty").html(i).appendTo(t)}$('<div class="alphabetInfo"></div>').appendTo(t)}DataTable.Api.register("alphabetSearch()",function(t){return this.iterator("table",function(a){a.alphabetSearch=t}),this}),DataTable.Api.register("alphabetSearch.recalc()",function(){return this.iterator("table",function(a){draw(new DataTable.Api(a),a._alphabet,a._alphabetOptions)}),this}),DataTable.Api.register("alphabetSearch.node()",function(){return this._context.length?this._context._alphabet:null}),DataTable.ext.search.push(function(a,t){if(!a.alphabetSearch)return!0;var e=0,n=!1;if(void 0!==a.oInit.alphabet&&(e=void 0!==a.oInit.alphabet.column?a.oInit.alphabet.column:0,n=void 0!==a.oInit.alphabet.caseSensitive&&a.oInit.alphabet.caseSensitive),n){if(t[e].charAt(0)===a.alphabetSearch)return!0}else if(t[e].charAt(0).toUpperCase()===a.alphabetSearch)return!0;return!1}),DataTable.AlphabetSearch=function(a){var t=new DataTable.Api(a),e=$('<div class="alphabet"/>'),n=$.extend({column:0,caseSensitive:!1,numbers:!1},t.init().alphabet);draw(t,e,n),a._alphabet=e,a._alphabetOptions=n,e.on("click","span",function(){e.find(".active").removeClass("active"),$(this).addClass("active"),t.alphabetSearch($(this).data("letter")).draw()}),e.on("mouseenter","span",function(){e.find("div.alphabetInfo").css({opacity:1,left:$(this).position().left,width:$(this).width()}).html($(this).data("match-count"))}).on("mouseleave","span",function(){e.find("div.alphabetInfo").css("opacity",0)}),this.node=function(){return e}},DataTable.ext.feature.push({fnInit:function(a){return new DataTable.AlphabetSearch(a).node()},cFeature:"A"}),DataTable.feature.register("alphabetSearch",function(a,t){return new DataTable.AlphabetSearch(a).node()});export default DataTable;

@ -18,9 +18,16 @@ let $ = jQuery;
*
* License MIT - http://datatables.net/license/mit
*
* For more detailed information please see:
* http://datatables.net/blog/2014-09-22
* Please see [this blog post](http://datatables.net/blog/2014-09-22).
*
* @example
* $('#myTable').DataTable( {
* layout: {
* topStart: 'alphabetSearch;
* }
* } );
*/
;
// Search function
DataTable.Api.register('alphabetSearch()', function (searchTerm) {
this.iterator('table', function (context) {
@ -177,6 +184,10 @@ DataTable.ext.feature.push({
},
cFeature: 'A',
});
DataTable.feature.register('alphabetSearch', function (settings, opts) {
var search = new DataTable.AlphabetSearch(settings);
return search.node();
});
export default DataTable;

@ -6,18 +6,20 @@
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0, user-scalable=no">
<title>DataTables example - Fuzzy Searching</title>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.4/css/jquery.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/2.0.0/css/dataTables.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="dataTables.alphabetSearch.css">
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.13.4/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-3.7.1.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/2.0.0/js/dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="dataTables.alphabetSearch.js"></script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() {
var table = $('#example').DataTable({
dom: 'Alfrtip'
layout: {
top: 'alphabetSearch'
}
});
} );
@ -512,11 +514,16 @@ $(document).ready(function() {
</tfoot>
</table>
</div>
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
<p>The Javascript shown below is used to initialise the table shown in this example:</p>
<code class="multiline language-js">
$(document).ready(function() {
var table = $('#example').DataTable({
fuzzySearch: true
layout: {
top: 'alphabetSearch'
}
});
} );</code>
} );
</code>
</div>
</section>
</body>

@ -12,12 +12,24 @@
*
* License MIT - http://datatables.net/license/mit
*
* For more detailed information please see:
* http://datatables.net/blog/2014-09-22
* Please see [this blog post](http://datatables.net/blog/2014-09-22).
*
* @example
* $('#myTable').DataTable( {
* layout: {
* topStart: 'alphabetSearch;
* }
* } );
*/
import DataTable from 'datatables.net';
interface AlphabetSearchOptions {
column?: number;
caseSensitive?: boolean;
numbers?: boolean;
};
declare module 'datatables.net' {
interface DataTablesStatic {
/** Show an set of alphabet buttons alongside a table providing search input options */
@ -25,11 +37,7 @@ declare module 'datatables.net' {
}
interface Config {
alphabet?: {
column: number;
caseSensitive: boolean;
numbers: boolean;
};
alphabet?: AlphabetSearchOptions;
}
interface Api<T> {
@ -45,6 +53,10 @@ declare module 'datatables.net' {
recalc(): Api<T>;
}
interface Feature {
alphabetSearch?: AlphabetSearchOptions;
}
}
// Search function
@ -240,3 +252,9 @@ DataTable.ext.feature.push({
},
cFeature: 'A',
});
DataTable.feature.register('alphabetSearch', function (settings, opts) {
var search = new DataTable.AlphabetSearch(settings);
return search.node();
});

@ -96,7 +96,7 @@ $(document).on('init.dt', function (e, dtSettings) {
var smallestLength = Math.min.apply(Math, lengthMenuValues);
if ($.isPlainObject(options) || options === true) {
var config = $.isPlainObject(options) ? options : {}, api = new DataTable.Api(dtSettings), speed = 500, conditionalPageLength = function (e) {
var $paging = $(api.table().container()).find('div.dataTables_length'), pages = api.page.info().pages, size = api.rows({ search: 'applied' }).count();
var $paging = $(api.table().container()).find('div.dt-length'), pages = api.page.info().pages, size = api.rows({ search: 'applied' }).count();
if (e instanceof $.Event) {
if (pages <= 1 && size <= smallestLength) {
if (config.style === 'fade') {

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd, Garrett Hyder - datatables.net/license */
!function(t){var i,a;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(i=require("jquery"),a=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"==typeof window?module.exports=function(e,n){return e=e||window,n=n||i(e),a(e,n),t(n,0,e.document)}:(a(window,i),module.exports=t(i,window,window.document))):t(jQuery,window,document)}(function(r,e,n,i){"use strict";var u=r.fn.dataTable;return r(n).on("init.dt",function(e,n){var a,o,d,s,t;"dt"===e.namespace&&(e=n.oInit.conditionalPageLength||u.defaults.conditionalPageLength,t=n.aLengthMenu||u.defaults.lengthMenu,t=(t=Array.isArray(t[0])?t[0]:t).filter(function(e){return 0<e}),a=Math.min.apply(Math,t),r.isPlainObject(e)||!0===e)&&(o=r.isPlainObject(e)?e:{},d=new u.Api(n),s=500,o.speed!==i&&(s=o.speed),(t=function(e){var n=r(d.table().container()).find("div.dataTables_length"),t=d.page.info().pages,i=d.rows({search:"applied"}).count();e instanceof r.Event?t<=1&&i<=a?"fade"===o.style?n.stop().fadeTo(s,0):n.css("visibility","hidden"):"fade"===o.style?n.stop().fadeTo(s,1):n.css("visibility",""):t<=1&&i<=a&&("fade"===o.style?n.css("opacity",0):n.css("visibility","hidden")),o.conditionalOptions&&n.find("select option").each(function(e){parseInt(r(this).attr("value"),10)>i?r(this).hide():r(this).show()})})(null),d.on("draw.dt",t))}),u});
!function(t){var i,o;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(i=require("jquery"),o=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"==typeof window?module.exports=function(e,n){return e=e||window,n=n||i(e),o(e,n),t(n,0,e.document)}:(o(window,i),module.exports=t(i,window,window.document))):t(jQuery,window,document)}(function(r,e,n){"use strict";var i=r.fn.dataTable;return r(n).on("init.dt",function(e,n){var o,a,d,s,t;"dt"===e.namespace&&(e=n.oInit.conditionalPageLength||i.defaults.conditionalPageLength,t=n.aLengthMenu||i.defaults.lengthMenu,t=(t=Array.isArray(t[0])?t[0]:t).filter(function(e){return 0<e}),o=Math.min.apply(Math,t),r.isPlainObject(e)||!0===e)&&(a=r.isPlainObject(e)?e:{},d=new i.Api(n),s=500,void 0!==a.speed&&(s=a.speed),(t=function(e){var n=r(d.table().container()).find("div.dt-length"),t=d.page.info().pages,i=d.rows({search:"applied"}).count();e instanceof r.Event?t<=1&&i<=o?"fade"===a.style?n.stop().fadeTo(s,0):n.css("visibility","hidden"):"fade"===a.style?n.stop().fadeTo(s,1):n.css("visibility",""):t<=1&&i<=o&&("fade"===a.style?n.css("opacity",0):n.css("visibility","hidden")),a.conditionalOptions&&n.find("select option").each(function(e){parseInt(r(this).attr("value"),10)>i?r(this).hide():r(this).show()})})(null),d.on("draw.dt",t))}),i});

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd, Garrett Hyder - datatables.net/license */
import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;$(document).on("init.dt",function(t,e){var n,s,o,l,a;"dt"===t.namespace&&(t=e.oInit.conditionalPageLength||DataTable.defaults.conditionalPageLength,a=e.aLengthMenu||DataTable.defaults.lengthMenu,a=(a=Array.isArray(a[0])?a[0]:a).filter(function(t){return 0<t}),n=Math.min.apply(Math,a),$.isPlainObject(t)||!0===t)&&(s=$.isPlainObject(t)?t:{},o=new DataTable.Api(e),l=500,void 0!==s.speed&&(l=s.speed),(a=function(t){var e=$(o.table().container()).find("div.dataTables_length"),a=o.page.info().pages,i=o.rows({search:"applied"}).count();t instanceof $.Event?a<=1&&i<=n?"fade"===s.style?e.stop().fadeTo(l,0):e.css("visibility","hidden"):"fade"===s.style?e.stop().fadeTo(l,1):e.css("visibility",""):a<=1&&i<=n&&("fade"===s.style?e.css("opacity",0):e.css("visibility","hidden")),s.conditionalOptions&&e.find("select option").each(function(t){parseInt($(this).attr("value"),10)>i?$(this).hide():$(this).show()})})(null),o.on("draw.dt",a))});export default DataTable;
import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;$(document).on("init.dt",function(t,e){var n,s,o,l,a;"dt"===t.namespace&&(t=e.oInit.conditionalPageLength||DataTable.defaults.conditionalPageLength,a=e.aLengthMenu||DataTable.defaults.lengthMenu,a=(a=Array.isArray(a[0])?a[0]:a).filter(function(t){return 0<t}),n=Math.min.apply(Math,a),$.isPlainObject(t)||!0===t)&&(s=$.isPlainObject(t)?t:{},o=new DataTable.Api(e),l=500,void 0!==s.speed&&(l=s.speed),(a=function(t){var e=$(o.table().container()).find("div.dt-length"),a=o.page.info().pages,i=o.rows({search:"applied"}).count();t instanceof $.Event?a<=1&&i<=n?"fade"===s.style?e.stop().fadeTo(l,0):e.css("visibility","hidden"):"fade"===s.style?e.stop().fadeTo(l,1):e.css("visibility",""):a<=1&&i<=n&&("fade"===s.style?e.css("opacity",0):e.css("visibility","hidden")),s.conditionalOptions&&e.find("select option").each(function(t){parseInt($(this).attr("value"),10)>i?$(this).hide():$(this).show()})})(null),o.on("draw.dt",a))});export default DataTable;

@ -56,7 +56,7 @@ $(document).on('init.dt', function (e, dtSettings) {
var smallestLength = Math.min.apply(Math, lengthMenuValues);
if ($.isPlainObject(options) || options === true) {
var config = $.isPlainObject(options) ? options : {}, api = new DataTable.Api(dtSettings), speed = 500, conditionalPageLength = function (e) {
var $paging = $(api.table().container()).find('div.dataTables_length'), pages = api.page.info().pages, size = api.rows({ search: 'applied' }).count();
var $paging = $(api.table().container()).find('div.dt-length'), pages = api.page.info().pages, size = api.rows({ search: 'applied' }).count();
if (e instanceof $.Event) {
if (pages <= 1 && size <= smallestLength) {
if (config.style === 'fade') {

@ -70,7 +70,7 @@ $(document).on('init.dt', function (e, dtSettings) {
api = new DataTable.Api(dtSettings),
speed = 500,
conditionalPageLength = function (e) {
var $paging = $(api.table().container()).find('div.dataTables_length'),
var $paging = $(api.table().container()).find('div.dt-length'),
pages = api.page.info().pages,
size = api.rows({ search: 'applied' }).count();

@ -79,7 +79,7 @@ $(document).on('init.dt', function (e, dtSettings) {
DataTable.defaults.conditionalPaging;
if ($.isPlainObject(options) || options === true) {
var config = $.isPlainObject(options) ? options : {}, api = new DataTable.Api(dtSettings), speed = 500, conditionalPaging = function (e) {
var $paging = $(api.table().container()).find('div.dataTables_paginate'), pages = api.page.info().pages;
var $paging = $(api.table().container()).find('div.dt-paging'), pages = api.page.info().pages;
if (e instanceof $.Event) {
if (pages <= 1) {
if (config.style === 'fade') {

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd, Matthew Hasbach - datatables.net/license */
!function(i){var t,d;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return i(e,window,document)}):"object"==typeof exports?(t=require("jquery"),d=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"==typeof window?module.exports=function(e,n){return e=e||window,n=n||t(e),d(e,n),i(n,0,e.document)}:(d(window,t),module.exports=i(t,window,window.document))):i(jQuery,window,document)}(function(o,e,n,i){"use strict";var s=o.fn.dataTable;return o(n).on("init.dt",function(e,n){var t,d,a;"dt"===e.namespace&&(e=n.oInit.conditionalPaging||s.defaults.conditionalPaging,o.isPlainObject(e)||!0===e)&&(t=o.isPlainObject(e)?e:{},d=new s.Api(n),a=500,t.speed!==i&&(a=t.speed),(e=function(e){var n=o(d.table().container()).find("div.dataTables_paginate"),i=d.page.info().pages;e instanceof o.Event?i<=1?"fade"===t.style?n.stop().fadeTo(a,0):n.css("visibility","hidden"):"fade"===t.style?n.stop().fadeTo(a,1):n.css("visibility",""):i<=1&&("fade"===t.style?n.css("opacity",0):n.css("visibility","hidden"))})(null),d.on("draw.dt",e))}),s});
!function(i){var t,d;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return i(e,window,document)}):"object"==typeof exports?(t=require("jquery"),d=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"==typeof window?module.exports=function(e,n){return e=e||window,n=n||t(e),d(e,n),i(n,0,e.document)}:(d(window,t),module.exports=i(t,window,window.document))):i(jQuery,window,document)}(function(a,e,n){"use strict";var i=a.fn.dataTable;return a(n).on("init.dt",function(e,n){var t,d,o;"dt"===e.namespace&&(e=n.oInit.conditionalPaging||i.defaults.conditionalPaging,a.isPlainObject(e)||!0===e)&&(t=a.isPlainObject(e)?e:{},d=new i.Api(n),o=500,void 0!==t.speed&&(o=t.speed),(e=function(e){var n=a(d.table().container()).find("div.dt-paging"),i=d.page.info().pages;e instanceof a.Event?i<=1?"fade"===t.style?n.stop().fadeTo(o,0):n.css("visibility","hidden"):"fade"===t.style?n.stop().fadeTo(o,1):n.css("visibility",""):i<=1&&("fade"===t.style?n.css("opacity",0):n.css("visibility","hidden"))})(null),d.on("draw.dt",e))}),i});

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd, Matthew Hasbach - datatables.net/license */
import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;$(document).on("init.dt",function(a,e){var t,n,s;"dt"===a.namespace&&(a=e.oInit.conditionalPaging||DataTable.defaults.conditionalPaging,$.isPlainObject(a)||!0===a)&&(t=$.isPlainObject(a)?a:{},n=new DataTable.Api(e),s=500,void 0!==t.speed&&(s=t.speed),(a=function(a){var e=$(n.table().container()).find("div.dataTables_paginate"),i=n.page.info().pages;a instanceof $.Event?i<=1?"fade"===t.style?e.stop().fadeTo(s,0):e.css("visibility","hidden"):"fade"===t.style?e.stop().fadeTo(s,1):e.css("visibility",""):i<=1&&("fade"===t.style?e.css("opacity",0):e.css("visibility","hidden"))})(null),n.on("draw.dt",a))});export default DataTable;
import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;$(document).on("init.dt",function(a,i){var t,n,d;"dt"===a.namespace&&(a=i.oInit.conditionalPaging||DataTable.defaults.conditionalPaging,$.isPlainObject(a)||!0===a)&&(t=$.isPlainObject(a)?a:{},n=new DataTable.Api(i),d=500,void 0!==t.speed&&(d=t.speed),(a=function(a){var i=$(n.table().container()).find("div.dt-paging"),e=n.page.info().pages;a instanceof $.Event?e<=1?"fade"===t.style?i.stop().fadeTo(d,0):i.css("visibility","hidden"):"fade"===t.style?i.stop().fadeTo(d,1):i.css("visibility",""):e<=1&&("fade"===t.style?i.css("opacity",0):i.css("visibility","hidden"))})(null),n.on("draw.dt",a))});export default DataTable;

@ -39,7 +39,7 @@ $(document).on('init.dt', function (e, dtSettings) {
DataTable.defaults.conditionalPaging;
if ($.isPlainObject(options) || options === true) {
var config = $.isPlainObject(options) ? options : {}, api = new DataTable.Api(dtSettings), speed = 500, conditionalPaging = function (e) {
var $paging = $(api.table().container()).find('div.dataTables_paginate'), pages = api.page.info().pages;
var $paging = $(api.table().container()).find('div.dt-paging'), pages = api.page.info().pages;
if (e instanceof $.Event) {
if (pages <= 1) {
if (config.style === 'fade') {

@ -50,7 +50,7 @@ $(document).on('init.dt', function (e, dtSettings) {
speed = 500,
conditionalPaging = function (e) {
var $paging = $(api.table().container()).find(
'div.dataTables_paginate'
'div.dt-paging'
),
pages = api.page.info().pages;

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */
!function(t){var o,i;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(o=require("jquery"),i=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"==typeof window?module.exports=function(e,n){return e=e||window,n=n||o(e),i(e,n),t(n,0,e.document)}:(i(window,o),module.exports=t(o,window,window.document))):t(jQuery,window,document)}(function(a,e,n,t){"use strict";var u=a.fn.dataTable;return u.ext.deepLink=function(e){for(var n=location.search.replace(/^\?/,"").split("&"),t={},o=0,i=n.length;o<i;o++){var r=n[o].split("="),d=decodeURIComponent(r[0]),r=decodeURIComponent(r[1]);if("true"===r)r=!0;else if("false"===r)r=!1;else if(r.match(/[^\d]/)||"search.search"===d){if(0===r.indexOf("{")||0===r.indexOf("["))try{r=a.parseJSON(r)}catch(e){}}else r=+r;"all"!==e&&-1===a.inArray(d,e)||u.util.set(d)(t,r,{})}return t},u});
!function(t){var o,i;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(o=require("jquery"),i=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"==typeof window?module.exports=function(e,n){return e=e||window,n=n||o(e),i(e,n),t(n,0,e.document)}:(i(window,o),module.exports=t(o,window,window.document))):t(jQuery,window,document)}(function(a,e,n){"use strict";var u=a.fn.dataTable;return u.ext.deepLink=function(e){for(var n=location.search.replace(/^\?/,"").split("&"),t={},o=0,i=n.length;o<i;o++){var r=n[o].split("="),d=decodeURIComponent(r[0]),r=decodeURIComponent(r[1]);if("true"===r)r=!0;else if("false"===r)r=!1;else if(r.match(/[^\d]/)||"search.search"===d){if(0===r.indexOf("{")||0===r.indexOf("["))try{r=a.parseJSON(r)}catch(e){}}else r=+r;"all"!==e&&-1===a.inArray(d,e)||u.util.set(d)(t,r,{})}return t},u});

@ -1,19 +0,0 @@
/*! © Ulises Gomez / Gravity Lending, SpryMedia Ltd - datatables.net/license */
declare module 'datatables.net' {
interface DataTablesStatic {
/** Add an input box that will remove matching items from the table */
ExcludeSearch(settings: any): void;
}
interface Config {
alphabet?: {
column: number;
caseSensitive: boolean;
numbers: boolean;
};
}
interface Api<T> {
/** Set an exclude term */
excludeSearch(searchTerm: string): Api<T>;
}
}
export {};

@ -1,111 +0,0 @@
/*! © Ulises Gomez / Gravity Lending, SpryMedia Ltd - datatables.net/license */
(function( factory ){
if ( typeof define === 'function' && define.amd ) {
// AMD
define( ['jquery', 'datatables.net'], function ( $ ) {
return factory( $, window, document );
} );
}
else if ( typeof exports === 'object' ) {
// CommonJS
var jq = require('jquery');
var cjsRequires = function (root, $) {
if ( ! $.fn.dataTable ) {
require('datatables.net')(root, $);
}
};
if (typeof window === 'undefined') {
module.exports = function (root, $) {
if ( ! root ) {
// CommonJS environments without a window global must pass a
// root. This will give an error otherwise
root = window;
}
if ( ! $ ) {
$ = jq( root );
}
cjsRequires( root, $ );
return factory( $, root, root.document );
};
}
else {
cjsRequires( window, jq );
module.exports = factory( jq, window, window.document );
}
}
else {
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document ) {
'use strict';
var DataTable = $.fn.dataTable;
/**
* @summary ExcludeSearch
* @description Add an input box that will remove matching items from the table
* @version 1.0.1
* @file dataTables.excludeSearch.js
* @author Ulises Gomez / Gravity Lending (https://www.linkedin.com/in/ulises-gomez/)
* @copyright Copyright 2023 Ulises Gomez
*
* License MIT - http://datatables.net/license/mit
*
* This feature adds a search input box to DataTables that will remove any rows that
* match the user's input from the display. Think of it as the inverse of the default
* search.
*
* An [example is available here](http://live.datatables.net/zohoyoqa/1/edit).
*
* @example
* $('#myTable').DataTable({
* excludeSearch: true
* });
*/
DataTable.Api.register('excludeSearch()', function (searchTerm) {
this.iterator('table', function (context) {
context.exclude_search = searchTerm;
});
return this;
});
DataTable.ext.search.push(function (context, search_data) {
if (context.exclude_search === '' ||
context.exclude_search === undefined ||
context.exclude_search === null) {
// No search term - all results shown
return true;
}
let show_row = true;
search_data.forEach(val => {
if (val.toUpperCase().includes(context.exclude_search.toUpperCase())) {
show_row = false;
}
});
return show_row;
});
DataTable.ExcludeSearch = function (context) {
let table = new DataTable.Api(context);
// class mx-3 is from bootstrap v4
let input_container = $('<div class="mx-3 dataTables_filter"><label>Exclude: </label><input type="text" /></div>');
input_container.find('input').on('input', function () {
table.excludeSearch($(this).val()).draw();
});
this.node = function () {
return input_container;
};
};
DataTable.ext.feature.push({
fnInit: function (settings) {
return new DataTable.ExcludeSearch(settings).node();
},
cFeature: 'X',
});
return DataTable;
}));

@ -1,2 +0,0 @@
/*! © Ulises Gomez / Gravity Lending, SpryMedia Ltd - datatables.net/license */
!function(t){var u,r;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(u=require("jquery"),r=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"==typeof window?module.exports=function(e,n){return e=e||window,n=n||u(e),r(e,n),t(n,0,e.document)}:(r(window,u),module.exports=t(u,window,window.document))):t(jQuery,window,document)}(function(u,e,n,r){"use strict";var i=u.fn.dataTable;return i.Api.register("excludeSearch()",function(n){return this.iterator("table",function(e){e.exclude_search=n}),this}),i.ext.search.push(function(n,e){if(""===n.exclude_search||n.exclude_search===r||null===n.exclude_search)return!0;let t=!0;return e.forEach(e=>{e.toUpperCase().includes(n.exclude_search.toUpperCase())&&(t=!1)}),t}),i.ExcludeSearch=function(e){let n=new i.Api(e),t=u('<div class="mx-3 dataTables_filter"><label>Exclude: </label><input type="text" /></div>');t.find("input").on("input",function(){n.excludeSearch(u(this).val()).draw()}),this.node=function(){return t}},i.ext.feature.push({fnInit:function(e){return new i.ExcludeSearch(e).node()},cFeature:"X"}),i});

@ -1,2 +0,0 @@
/*! © Ulises Gomez / Gravity Lending, SpryMedia Ltd - datatables.net/license */
import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;DataTable.Api.register("excludeSearch()",function(a){return this.iterator("table",function(e){e.exclude_search=a}),this}),DataTable.ext.search.push(function(a,e){if(""===a.exclude_search||void 0===a.exclude_search||null===a.exclude_search)return!0;let t=!0;return e.forEach(e=>{e.toUpperCase().includes(a.exclude_search.toUpperCase())&&(t=!1)}),t}),DataTable.ExcludeSearch=function(e){let a=new DataTable.Api(e),t=$('<div class="mx-3 dataTables_filter"><label>Exclude: </label><input type="text" /></div>');t.find("input").on("input",function(){a.excludeSearch($(this).val()).draw()}),this.node=function(){return t}},DataTable.ext.feature.push({fnInit:function(e){return new DataTable.ExcludeSearch(e).node()},cFeature:"X"});export default DataTable;

@ -1,70 +0,0 @@
/*! © Ulises Gomez / Gravity Lending, SpryMedia Ltd - datatables.net/license */
import jQuery from 'jquery';
import DataTable from 'datatables.net';
// Allow reassignment of the $ variable
let $ = jQuery;
/**
* @summary ExcludeSearch
* @description Add an input box that will remove matching items from the table
* @version 1.0.1
* @file dataTables.excludeSearch.js
* @author Ulises Gomez / Gravity Lending (https://www.linkedin.com/in/ulises-gomez/)
* @copyright Copyright 2023 Ulises Gomez
*
* License MIT - http://datatables.net/license/mit
*
* This feature adds a search input box to DataTables that will remove any rows that
* match the user's input from the display. Think of it as the inverse of the default
* search.
*
* An [example is available here](http://live.datatables.net/zohoyoqa/1/edit).
*
* @example
* $('#myTable').DataTable({
* excludeSearch: true
* });
*/
DataTable.Api.register('excludeSearch()', function (searchTerm) {
this.iterator('table', function (context) {
context.exclude_search = searchTerm;
});
return this;
});
DataTable.ext.search.push(function (context, search_data) {
if (context.exclude_search === '' ||
context.exclude_search === undefined ||
context.exclude_search === null) {
// No search term - all results shown
return true;
}
let show_row = true;
search_data.forEach(val => {
if (val.toUpperCase().includes(context.exclude_search.toUpperCase())) {
show_row = false;
}
});
return show_row;
});
DataTable.ExcludeSearch = function (context) {
let table = new DataTable.Api(context);
// class mx-3 is from bootstrap v4
let input_container = $('<div class="mx-3 dataTables_filter"><label>Exclude: </label><input type="text" /></div>');
input_container.find('input').on('input', function () {
table.excludeSearch($(this).val()).draw();
});
this.node = function () {
return input_container;
};
};
DataTable.ext.feature.push({
fnInit: function (settings) {
return new DataTable.ExcludeSearch(settings).node();
},
cFeature: 'X',
});
export default DataTable;

@ -1,94 +0,0 @@
/*! © Ulises Gomez / Gravity Lending, SpryMedia Ltd - datatables.net/license */
/**
* @summary ExcludeSearch
* @description Add an input box that will remove matching items from the table
* @version 1.0.1
* @file dataTables.excludeSearch.js
* @author Ulises Gomez / Gravity Lending (https://www.linkedin.com/in/ulises-gomez/)
* @copyright Copyright 2023 Ulises Gomez
*
* License MIT - http://datatables.net/license/mit
*
* This feature adds a search input box to DataTables that will remove any rows that
* match the user's input from the display. Think of it as the inverse of the default
* search.
*
* An [example is available here](http://live.datatables.net/zohoyoqa/1/edit).
*
* @example
* $('#myTable').DataTable({
* excludeSearch: true
* });
*/
import DataTable from 'datatables.net';
declare module 'datatables.net' {
interface DataTablesStatic {
/** Add an input box that will remove matching items from the table */
ExcludeSearch(settings: any): void;
}
interface Config {
alphabet?: {
column: number;
caseSensitive: boolean;
numbers: boolean;
};
}
interface Api<T> {
/** Set an exclude term */
excludeSearch(searchTerm: string): Api<T>;
}
}
DataTable.Api.register('excludeSearch()', function (searchTerm) {
this.iterator('table', function (context) {
context.exclude_search = searchTerm;
});
return this;
});
DataTable.ext.search.push(function (context, search_data) {
if (
context.exclude_search === '' ||
context.exclude_search === undefined ||
context.exclude_search === null
) {
// No search term - all results shown
return true;
}
let show_row = true;
search_data.forEach(val => {
if (val.toUpperCase().includes(context.exclude_search.toUpperCase())) {
show_row = false;
}
});
return show_row;
});
DataTable.ExcludeSearch = function (context) {
let table = new DataTable.Api(context);
// class mx-3 is from bootstrap v4
let input_container = $(
'<div class="mx-3 dataTables_filter"><label>Exclude: </label><input type="text" /></div>'
);
input_container.find('input').on('input', function () {
table.excludeSearch($(this).val() as string).draw();
});
this.node = function () {
return input_container;
};
};
DataTable.ext.feature.push({
fnInit: function (settings) {
return new DataTable.ExcludeSearch(settings).node();
},
cFeature: 'X',
});

@ -210,22 +210,24 @@ DataTable.ext.search.push(function (settings, data, dataIndex) {
if (!initial) {
return true;
}
// If fuzzy searching has not been implemented then pass all rows for this function
if (settings.aoData[dataIndex]._fuzzySearch !== undefined) {
// Read score to set the cell content and sort data
var score = settings.aoData[dataIndex]._fuzzySearch.score;
if (initial.rankColumn !== undefined) {
settings.aoData[dataIndex].anCells[initial.rankColumn].innerHTML = score;
// Remove '%' from the end of the score so can sort on a number
settings.aoData[dataIndex]._aSortData[initial.rankColumn] =
+score.substring(0, score.length - 1);
if (settings.aoData[dataIndex]) {
// If fuzzy searching has not been implemented then pass all rows for this function
if (settings.aoData[dataIndex]._fuzzySearch !== undefined) {
// Read score to set the cell content and sort data
var score = settings.aoData[dataIndex]._fuzzySearch.score;
if (initial.rankColumn !== undefined) {
settings.aoData[dataIndex].anCells[initial.rankColumn].innerHTML = score;
// Remove '%' from the end of the score so can sort on a number
settings.aoData[dataIndex]._aSortData[initial.rankColumn] =
+score.substring(0, score.length - 1);
}
// Return the value for the pass as decided by the fuzzySearch function
return settings.aoData[dataIndex]._fuzzySearch.pass;
}
else if (initial.rankColumn !== undefined) {
settings.aoData[dataIndex].anCells[initial.rankColumn].innerHTML = '';
settings.aoData[dataIndex]._aSortData[initial.rankColumn] = '';
}
// Return the value for the pass as decided by the fuzzySearch function
return settings.aoData[dataIndex]._fuzzySearch.pass;
}
else if (initial.rankColumn !== undefined) {
settings.aoData[dataIndex].anCells[initial.rankColumn].innerHTML = '';
settings.aoData[dataIndex]._aSortData[initial.rankColumn] = '';
}
return true;
});
@ -239,7 +241,7 @@ $(document).on('init.dt', function (e, settings) {
}
var fromPlugin = false;
// Find the input element
var input = $('div.dataTables_filter input', api.table().container());
var input = $('div.dt-search input', api.table().container());
var fontBold = {
'font-weight': '600',
'background-color': 'rgba(255,255,255,0.1)',
@ -260,7 +262,7 @@ $(document).on('init.dt', function (e, settings) {
};
// Only going to set the toggle if it is enabled
var toggle, tooltip, exact, fuzzy, label;
if (typeof initialFuzzy === 'object' && initialFuzzy.toggleSmart) {
if (initialFuzzy === true || initialFuzzy.toggleSmart) {
toggle = $('<button class="toggleSearch">Abc</button>')
.insertAfter(input)
.css({

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -170,22 +170,24 @@ DataTable.ext.search.push(function (settings, data, dataIndex) {
if (!initial) {
return true;
}
// If fuzzy searching has not been implemented then pass all rows for this function
if (settings.aoData[dataIndex]._fuzzySearch !== undefined) {
// Read score to set the cell content and sort data
var score = settings.aoData[dataIndex]._fuzzySearch.score;
if (initial.rankColumn !== undefined) {
settings.aoData[dataIndex].anCells[initial.rankColumn].innerHTML = score;
// Remove '%' from the end of the score so can sort on a number
settings.aoData[dataIndex]._aSortData[initial.rankColumn] =
+score.substring(0, score.length - 1);
if (settings.aoData[dataIndex]) {
// If fuzzy searching has not been implemented then pass all rows for this function
if (settings.aoData[dataIndex]._fuzzySearch !== undefined) {
// Read score to set the cell content and sort data
var score = settings.aoData[dataIndex]._fuzzySearch.score;
if (initial.rankColumn !== undefined) {
settings.aoData[dataIndex].anCells[initial.rankColumn].innerHTML = score;
// Remove '%' from the end of the score so can sort on a number
settings.aoData[dataIndex]._aSortData[initial.rankColumn] =
+score.substring(0, score.length - 1);
}
// Return the value for the pass as decided by the fuzzySearch function
return settings.aoData[dataIndex]._fuzzySearch.pass;
}
else if (initial.rankColumn !== undefined) {
settings.aoData[dataIndex].anCells[initial.rankColumn].innerHTML = '';
settings.aoData[dataIndex]._aSortData[initial.rankColumn] = '';
}
// Return the value for the pass as decided by the fuzzySearch function
return settings.aoData[dataIndex]._fuzzySearch.pass;
}
else if (initial.rankColumn !== undefined) {
settings.aoData[dataIndex].anCells[initial.rankColumn].innerHTML = '';
settings.aoData[dataIndex]._aSortData[initial.rankColumn] = '';
}
return true;
});
@ -199,7 +201,7 @@ $(document).on('init.dt', function (e, settings) {
}
var fromPlugin = false;
// Find the input element
var input = $('div.dataTables_filter input', api.table().container());
var input = $('div.dt-search input', api.table().container());
var fontBold = {
'font-weight': '600',
'background-color': 'rgba(255,255,255,0.1)',
@ -220,7 +222,7 @@ $(document).on('init.dt', function (e, settings) {
};
// Only going to set the toggle if it is enabled
var toggle, tooltip, exact, fuzzy, label;
if (typeof initialFuzzy === 'object' && initialFuzzy.toggleSmart) {
if (initialFuzzy === true || initialFuzzy.toggleSmart) {
toggle = $('<button class="toggleSearch">Abc</button>')
.insertAfter(input)
.css({

@ -6,7 +6,7 @@
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0, user-scalable=no">
<title>DataTables example - Fuzzy Searching</title>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/2.0.0/css/dataTables.dataTables.min.css">
<style type="text/css" class="init">
div.container {
margin: 0 auto;
@ -47,8 +47,8 @@
display: none;
}
</style>
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-3.7.1.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/2.0.0/js/dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="dataTables.fuzzySearch.js"></script>
<script type="text/javascript" language="javascript" class="init">

@ -6,7 +6,7 @@
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0, user-scalable=no">
<title>DataTables example - Fuzzy Searching</title>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/2.0.0/css/dataTables.dataTables.min.css">
<style type="text/css" class="init">
div.container {
margin: 0 auto;
@ -47,8 +47,8 @@
display: none;
}
</style>
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-3.7.1.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/2.0.0/js/dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="dataTables.fuzzySearch.js"></script>
<script type="text/javascript" language="javascript" class="init">

@ -6,7 +6,7 @@
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0, user-scalable=no">
<title>DataTables example - Fuzzy Searching</title>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/2.0.0/css/dataTables.dataTables.min.css">
<style type="text/css" class="init">
div.container {
margin: 0 auto;
@ -47,8 +47,8 @@
display: none;
}
</style>
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-3.7.1.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/2.0.0/js/dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="dataTables.fuzzySearch.js"></script>
<script type="text/javascript" language="javascript" class="init">

@ -218,25 +218,27 @@ DataTable.ext.search.push(function (settings, data, dataIndex) {
return true;
}
// If fuzzy searching has not been implemented then pass all rows for this function
if (settings.aoData[dataIndex]._fuzzySearch !== undefined) {
// Read score to set the cell content and sort data
var score = settings.aoData[dataIndex]._fuzzySearch.score;
if (initial.rankColumn !== undefined) {
settings.aoData[dataIndex].anCells[initial.rankColumn].innerHTML = score;
if (settings.aoData[dataIndex]) {
// If fuzzy searching has not been implemented then pass all rows for this function
if (settings.aoData[dataIndex]._fuzzySearch !== undefined) {
// Read score to set the cell content and sort data
var score = settings.aoData[dataIndex]._fuzzySearch.score;
if (initial.rankColumn !== undefined) {
settings.aoData[dataIndex].anCells[initial.rankColumn].innerHTML = score;
// Remove '%' from the end of the score so can sort on a number
settings.aoData[dataIndex]._aSortData[initial.rankColumn] =
+score.substring(0, score.length - 1);
}
// Remove '%' from the end of the score so can sort on a number
settings.aoData[dataIndex]._aSortData[initial.rankColumn] =
+score.substring(0, score.length - 1);
// Return the value for the pass as decided by the fuzzySearch function
return settings.aoData[dataIndex]._fuzzySearch.pass;
}
else if (initial.rankColumn !== undefined) {
settings.aoData[dataIndex].anCells[initial.rankColumn].innerHTML = '';
settings.aoData[dataIndex]._aSortData[initial.rankColumn] = '';
}
// Return the value for the pass as decided by the fuzzySearch function
return settings.aoData[dataIndex]._fuzzySearch.pass;
}
else if (initial.rankColumn !== undefined) {
settings.aoData[dataIndex].anCells[initial.rankColumn].innerHTML = '';
settings.aoData[dataIndex]._aSortData[initial.rankColumn] = '';
}
return true;
@ -255,7 +257,7 @@ $(document).on('init.dt', function (e, settings) {
var fromPlugin = false;
// Find the input element
var input = $('div.dataTables_filter input', api.table().container());
var input = $('div.dt-search input', api.table().container());
var fontBold = {
'font-weight': '600',
@ -278,7 +280,7 @@ $(document).on('init.dt', function (e, settings) {
// Only going to set the toggle if it is enabled
var toggle, tooltip, exact, fuzzy, label;
if (typeof initialFuzzy === 'object' && initialFuzzy.toggleSmart) {
if (initialFuzzy === true || initialFuzzy.toggleSmart) {
toggle = $('<button class="toggleSearch">Abc</button>')
.insertAfter(input)
.css({

@ -6,7 +6,7 @@
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0, user-scalable=no">
<title>DataTables example - Fuzzy Searching</title>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/2.0.0/css/dataTables.dataTables.min.css">
<style type="text/css" class="init">
div.container {
margin: 0 auto;
@ -47,8 +47,8 @@
display: none;
}
</style>
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-3.7.1.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/2.0.0/js/dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="dataTables.fuzzySearch.js"></script>
<script type="text/javascript" language="javascript" class="init">

@ -6,7 +6,7 @@
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0, user-scalable=no">
<title>DataTables example - Fuzzy Searching</title>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/2.0.0/css/dataTables.dataTables.min.css">
<style type="text/css" class="init">
div.container {
margin: 0 auto;
@ -47,8 +47,8 @@
display: none;
}
</style>
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-3.7.1.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/2.0.0/js/dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="dataTables.fuzzySearch.js"></script>
<script type="text/javascript" language="javascript" class="init">

@ -6,7 +6,7 @@
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0, user-scalable=no">
<title>DataTables example - Fuzzy Searching</title>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/2.0.0/css/dataTables.dataTables.min.css">
<style type="text/css" class="init">
div.container {
margin: 0 auto;
@ -47,8 +47,8 @@
display: none;
}
</style>
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-3.7.1.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/2.0.0/js/dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="dataTables.fuzzySearch.js"></script>
<script type="text/javascript" language="javascript" class="init">

@ -1,4 +1,6 @@
div.dataTables_length a.active {
div.dt-lengthLinks a.active {
color: black;
text-decoration: underline;
cursor: pointer;
}

@ -4,5 +4,8 @@ declare module 'datatables.net' {
/** Page length control via links for DataTables */
LengthLinks(settings: any): void;
}
interface Feature {
lengthLinks?: {};
}
}
export {};

@ -53,25 +53,28 @@ var DataTable = $.fn.dataTable;
* @author Allan Jardine
*
* This feature plug-in for DataTables adds page length control links to the
* DataTable. The `dom` option can be used to insert the control using the `L`
* character option and it uses the `lengthMenu` options of DataTables to
* determine what to display.
* DataTable. The `-init layout` option can be used to insert the control
* using the `lengthLinks` option.
*
* @example
* $('#myTable').DataTable( {
* dom: 'Lfrtip'
* layout: {
* topStart: 'lengthLinks;
* }
* } );
*
* @example
* $('#myTable').DataTable( {
* layout: {
* topStart: 'lengthLinks;
* },
* lengthMenu: [ [10, 25, 50, -1], [10, 25, 50, "All"] ]
* dom: 'Lfrtip'
* } );
*/
DataTable.LengthLinks = function (inst) {
var api = new DataTable.Api(inst);
var settings = api.settings()[0];
var container = $('<div></div>').addClass(settings.oClasses.sLength);
var container = $('<div></div>').addClass('dt-lengthLinks');
var lastLength = null;
// API so the feature wrapper can return the node to insert
this.container = function () {
@ -96,7 +99,9 @@ DataTable.LengthLinks = function (inst) {
? '<a class="active" data-length="' + lens[i] + '">' + lang[i] + '</a>'
: '<a data-length="' + lens[i] + '">' + lang[i] + '</a>';
});
container.html(settings.oLanguage.sLengthMenu.replace('_MENU_', out.join(' | ')));
container.html(settings.oLanguage.sLengthMenu
.replace('_MENU_', out.join(' | '))
.replace('_ENTRIES_', api.i18n('entries', '', 10)));
lastLength = api.page.len();
});
api.on('destroy', function () {
@ -112,6 +117,10 @@ DataTable.ext.feature.push({
cFeature: 'L',
sFeature: 'LengthLinks',
});
DataTable.feature.register('lengthLinks', function (settings) {
var l = new DataTable.LengthLinks(settings);
return l.container();
});
return DataTable;

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */
!function(t){var a,i;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(n){return t(n,window,document)}):"object"==typeof exports?(a=require("jquery"),i=function(n,e){e.fn.dataTable||require("datatables.net")(n,e)},"undefined"==typeof window?module.exports=function(n,e){return n=n||window,e=e||a(n),i(n,e),t(e,0,n.document)}:(i(window,a),module.exports=t(a,window,window.document))):t(jQuery,window,document)}(function(u,n,e,t){"use strict";var a=u.fn.dataTable;return a.LengthLinks=function(n){var i=new a.Api(n),e=i.settings()[0],r=u("<div></div>").addClass(e.oClasses.sLength),o=null;this.container=function(){return r[0]},r.on("click.dtll","a",function(n){n.preventDefault(),i.page.len(+u(this).data("length")).draw(!1)}),i.on("draw",function(){var t,a,n;i.page.len()!==o&&(n=e.aLengthMenu,t=2===n.length&&Array.isArray(n[0])?n[1]:n,a=2===n.length&&Array.isArray(n[0])?n[0]:n,n=u.map(a,function(n,e){return n==i.page.len()?'<a class="active" data-length="'+a[e]+'">'+t[e]+"</a>":'<a data-length="'+a[e]+'">'+t[e]+"</a>"}),r.html(e.oLanguage.sLengthMenu.replace("_MENU_",n.join(" | "))),o=i.page.len())}),i.on("destroy",function(){r.off("click.dtll","a")})},a.ext.feature.push({fnInit:function(n){return new a.LengthLinks(n).container()},cFeature:"L",sFeature:"LengthLinks"}),a});
!function(t){var a,i;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(n){return t(n,window,document)}):"object"==typeof exports?(a=require("jquery"),i=function(n,e){e.fn.dataTable||require("datatables.net")(n,e)},"undefined"==typeof window?module.exports=function(n,e){return n=n||window,e=e||a(n),i(n,e),t(e,0,n.document)}:(i(window,a),module.exports=t(a,window,window.document))):t(jQuery,window,document)}(function(u,n,e){"use strict";var t=u.fn.dataTable;return t.LengthLinks=function(n){var i=new t.Api(n),e=i.settings()[0],r=u("<div></div>").addClass("dt-lengthLinks"),o=null;this.container=function(){return r[0]},r.on("click.dtll","a",function(n){n.preventDefault(),i.page.len(+u(this).data("length")).draw(!1)}),i.on("draw",function(){var t,a,n;i.page.len()!==o&&(n=e.aLengthMenu,t=2===n.length&&Array.isArray(n[0])?n[1]:n,a=2===n.length&&Array.isArray(n[0])?n[0]:n,n=u.map(a,function(n,e){return n==i.page.len()?'<a class="active" data-length="'+a[e]+'">'+t[e]+"</a>":'<a data-length="'+a[e]+'">'+t[e]+"</a>"}),r.html(e.oLanguage.sLengthMenu.replace("_MENU_",n.join(" | ")).replace("_ENTRIES_",i.i18n("entries","",10))),o=i.page.len())}),i.on("destroy",function(){r.off("click.dtll","a")})},t.ext.feature.push({fnInit:function(n){return new t.LengthLinks(n).container()},cFeature:"L",sFeature:"LengthLinks"}),t.feature.register("lengthLinks",function(n){return new t.LengthLinks(n).container()}),t});

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */
import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;DataTable.LengthLinks=function(a){var r=new DataTable.Api(a),e=r.settings()[0],l=$("<div></div>").addClass(e.oClasses.sLength),i=null;this.container=function(){return l[0]},l.on("click.dtll","a",function(a){a.preventDefault(),r.page.len(+$(this).data("length")).draw(!1)}),r.on("draw",function(){var t,n,a;r.page.len()!==i&&(a=e.aLengthMenu,t=2===a.length&&Array.isArray(a[0])?a[1]:a,n=2===a.length&&Array.isArray(a[0])?a[0]:a,a=$.map(n,function(a,e){return a==r.page.len()?'<a class="active" data-length="'+n[e]+'">'+t[e]+"</a>":'<a data-length="'+n[e]+'">'+t[e]+"</a>"}),l.html(e.oLanguage.sLengthMenu.replace("_MENU_",a.join(" | "))),i=r.page.len())}),r.on("destroy",function(){l.off("click.dtll","a")})},DataTable.ext.feature.push({fnInit:function(a){return new DataTable.LengthLinks(a).container()},cFeature:"L",sFeature:"LengthLinks"});export default DataTable;
import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;DataTable.LengthLinks=function(e){var r=new DataTable.Api(e),a=r.settings()[0],l=$("<div></div>").addClass("dt-lengthLinks"),i=null;this.container=function(){return l[0]},l.on("click.dtll","a",function(e){e.preventDefault(),r.page.len(+$(this).data("length")).draw(!1)}),r.on("draw",function(){var n,t,e;r.page.len()!==i&&(e=a.aLengthMenu,n=2===e.length&&Array.isArray(e[0])?e[1]:e,t=2===e.length&&Array.isArray(e[0])?e[0]:e,e=$.map(t,function(e,a){return e==r.page.len()?'<a class="active" data-length="'+t[a]+'">'+n[a]+"</a>":'<a data-length="'+t[a]+'">'+n[a]+"</a>"}),l.html(a.oLanguage.sLengthMenu.replace("_MENU_",e.join(" | ")).replace("_ENTRIES_",r.i18n("entries","",10))),i=r.page.len())}),r.on("destroy",function(){l.off("click.dtll","a")})},DataTable.ext.feature.push({fnInit:function(e){return new DataTable.LengthLinks(e).container()},cFeature:"L",sFeature:"LengthLinks"}),DataTable.feature.register("lengthLinks",function(e){return new DataTable.LengthLinks(e).container()});export default DataTable;

@ -13,25 +13,28 @@ let $ = jQuery;
* @author Allan Jardine
*
* This feature plug-in for DataTables adds page length control links to the
* DataTable. The `dom` option can be used to insert the control using the `L`
* character option and it uses the `lengthMenu` options of DataTables to
* determine what to display.
* DataTable. The `-init layout` option can be used to insert the control
* using the `lengthLinks` option.
*
* @example
* $('#myTable').DataTable( {
* dom: 'Lfrtip'
* layout: {
* topStart: 'lengthLinks;
* }
* } );
*
* @example
* $('#myTable').DataTable( {
* layout: {
* topStart: 'lengthLinks;
* },
* lengthMenu: [ [10, 25, 50, -1], [10, 25, 50, "All"] ]
* dom: 'Lfrtip'
* } );
*/
DataTable.LengthLinks = function (inst) {
var api = new DataTable.Api(inst);
var settings = api.settings()[0];
var container = $('<div></div>').addClass(settings.oClasses.sLength);
var container = $('<div></div>').addClass('dt-lengthLinks');
var lastLength = null;
// API so the feature wrapper can return the node to insert
this.container = function () {
@ -56,7 +59,9 @@ DataTable.LengthLinks = function (inst) {
? '<a class="active" data-length="' + lens[i] + '">' + lang[i] + '</a>'
: '<a data-length="' + lens[i] + '">' + lang[i] + '</a>';
});
container.html(settings.oLanguage.sLengthMenu.replace('_MENU_', out.join(' | ')));
container.html(settings.oLanguage.sLengthMenu
.replace('_MENU_', out.join(' | '))
.replace('_ENTRIES_', api.i18n('entries', '', 10)));
lastLength = api.page.len();
});
api.on('destroy', function () {
@ -72,6 +77,10 @@ DataTable.ext.feature.push({
cFeature: 'L',
sFeature: 'LengthLinks',
});
DataTable.feature.register('lengthLinks', function (settings) {
var l = new DataTable.LengthLinks(settings);
return l.container();
});
export default DataTable;

@ -0,0 +1,530 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0, user-scalable=no">
<title>DataTables example - Fuzzy Searching</title>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/2.0.0/css/dataTables.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="dataTables.lengthLinks.css">
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-3.7.1.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/2.0.0/js/dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="dataTables.lengthLinks.js"></script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() {
var table = $('#example').DataTable({
layout: {
topStart: 'lengthLinks'
}
});
} );
</script>
</head>
<body class="dt-example">
<div class="container">
<section>
<h1>DataTables example <span>Length links</span></h1>
<div class="info">
</div>
<div class="demo-html">
<table id="example" class="display" style="width:100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tbody>
<tr>
<td>Tiger Nixon</td>
<td>System Architect</td>
<td>Edinburgh</td>
<td>61</td>
<td>2011/04/25</td>
<td>$320,800</td>
</tr>
<tr>
<td>Garrett Winters</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>63</td>
<td>2011/07/25</td>
<td>$170,750</td>
</tr>
<tr>
<td>Ashton Cox</td>
<td>Junior Technical Author</td>
<td>San Francisco</td>
<td>66</td>
<td>2009/01/12</td>
<td>$86,000</td>
</tr>
<tr>
<td>Cedric Kelly</td>
<td>Senior Javascript Developer</td>
<td>Edinburgh</td>
<td>22</td>
<td>2012/03/29</td>
<td>$433,060</td>
</tr>
<tr>
<td>Airi Satou</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>33</td>
<td>2008/11/28</td>
<td>$162,700</td>
</tr>
<tr>
<td>Brielle Williamson</td>
<td>Integration Specialist</td>
<td>New York</td>
<td>61</td>
<td>2012/12/02</td>
<td>$372,000</td>
</tr>
<tr>
<td>Herrod Chandler</td>
<td>Sales Assistant</td>
<td>San Francisco</td>
<td>59</td>
<td>2012/08/06</td>
<td>$137,500</td>
</tr>
<tr>
<td>Rhona Davidson</td>
<td>Integration Specialist</td>
<td>Tokyo</td>
<td>55</td>
<td>2010/10/14</td>
<td>$327,900</td>
</tr>
<tr>
<td>Colleen Hurst</td>
<td>Javascript Developer</td>
<td>San Francisco</td>
<td>39</td>
<td>2009/09/15</td>
<td>$205,500</td>
</tr>
<tr>
<td>Sonya Frost</td>
<td>Software Engineer</td>
<td>Edinburgh</td>
<td>23</td>
<td>2008/12/13</td>
<td>$103,600</td>
</tr>
<tr>
<td>Jena Gaines</td>
<td>Office Manager</td>
<td>London</td>
<td>30</td>
<td>2008/12/19</td>
<td>$90,560</td>
</tr>
<tr>
<td>Quinn Flynn</td>
<td>Support Lead</td>
<td>Edinburgh</td>
<td>22</td>
<td>2013/03/03</td>
<td>$342,000</td>
</tr>
<tr>
<td>Charde Marshall</td>
<td>Regional Director</td>
<td>San Francisco</td>
<td>36</td>
<td>2008/10/16</td>
<td>$470,600</td>
</tr>
<tr>
<td>Haley Kennedy</td>
<td>Senior Marketing Designer</td>
<td>London</td>
<td>43</td>
<td>2012/12/18</td>
<td>$313,500</td>
</tr>
<tr>
<td>Tatyana Fitzpatrick</td>
<td>Regional Director</td>
<td>London</td>
<td>19</td>
<td>2010/03/17</td>
<td>$385,750</td>
</tr>
<tr>
<td>Michael Silva</td>
<td>Marketing Designer</td>
<td>London</td>
<td>66</td>
<td>2012/11/27</td>
<td>$198,500</td>
</tr>
<tr>
<td>Paul Byrd</td>
<td>Chief Financial Officer (CFO)</td>
<td>New York</td>
<td>64</td>
<td>2010/06/09</td>
<td>$725,000</td>
</tr>
<tr>
<td>Gloria Little</td>
<td>Systems Administrator</td>
<td>New York</td>
<td>59</td>
<td>2009/04/10</td>
<td>$237,500</td>
</tr>
<tr>
<td>Bradley Greer</td>
<td>Software Engineer</td>
<td>London</td>
<td>41</td>
<td>2012/10/13</td>
<td>$132,000</td>
</tr>
<tr>
<td>Dai Rios</td>
<td>Personnel Lead</td>
<td>Edinburgh</td>
<td>35</td>
<td>2012/09/26</td>
<td>$217,500</td>
</tr>
<tr>
<td>Jenette Caldwell</td>
<td>Development Lead</td>
<td>New York</td>
<td>30</td>
<td>2011/09/03</td>
<td>$345,000</td>
</tr>
<tr>
<td>Yuri Berry</td>
<td>Chief Marketing Officer (CMO)</td>
<td>New York</td>
<td>40</td>
<td>2009/06/25</td>
<td>$675,000</td>
</tr>
<tr>
<td>Caesar Vance</td>
<td>Pre-Sales Support</td>
<td>New York</td>
<td>21</td>
<td>2011/12/12</td>
<td>$106,450</td>
</tr>
<tr>
<td>Doris Wilder</td>
<td>Sales Assistant</td>
<td>Sydney</td>
<td>23</td>
<td>2010/09/20</td>
<td>$85,600</td>
</tr>
<tr>
<td>Angelica Ramos</td>
<td>Chief Executive Officer (CEO)</td>
<td>London</td>
<td>47</td>
<td>2009/10/09</td>
<td>$1,200,000</td>
</tr>
<tr>
<td>Gavin Joyce</td>
<td>Developer</td>
<td>Edinburgh</td>
<td>42</td>
<td>2010/12/22</td>
<td>$92,575</td>
</tr>
<tr>
<td>Jennifer Chang</td>
<td>Regional Director</td>
<td>Singapore</td>
<td>28</td>
<td>2010/11/14</td>
<td>$357,650</td>
</tr>
<tr>
<td>Brenden Wagner</td>
<td>Software Engineer</td>
<td>San Francisco</td>
<td>28</td>
<td>2011/06/07</td>
<td>$206,850</td>
</tr>
<tr>
<td>Fiona Green</td>
<td>Chief Operating Officer (COO)</td>
<td>San Francisco</td>
<td>48</td>
<td>2010/03/11</td>
<td>$850,000</td>
</tr>
<tr>
<td>Shou Itou</td>
<td>Regional Marketing</td>
<td>Tokyo</td>
<td>20</td>
<td>2011/08/14</td>
<td>$163,000</td>
</tr>
<tr>
<td>Michelle House</td>
<td>Integration Specialist</td>
<td>Sydney</td>
<td>37</td>
<td>2011/06/02</td>
<td>$95,400</td>
</tr>
<tr>
<td>Suki Burks</td>
<td>Developer</td>
<td>London</td>
<td>53</td>
<td>2009/10/22</td>
<td>$114,500</td>
</tr>
<tr>
<td>Prescott Bartlett</td>
<td>Technical Author</td>
<td>London</td>
<td>27</td>
<td>2011/05/07</td>
<td>$145,000</td>
</tr>
<tr>
<td>Gavin Cortez</td>
<td>Team Leader</td>
<td>San Francisco</td>
<td>22</td>
<td>2008/10/26</td>
<td>$235,500</td>
</tr>
<tr>
<td>Martena Mccray</td>
<td>Post-Sales support</td>
<td>Edinburgh</td>
<td>46</td>
<td>2011/03/09</td>
<td>$324,050</td>
</tr>
<tr>
<td>Unity Butler</td>
<td>Marketing Designer</td>
<td>San Francisco</td>
<td>47</td>
<td>2009/12/09</td>
<td>$85,675</td>
</tr>
<tr>
<td>Howard Hatfield</td>
<td>Office Manager</td>
<td>San Francisco</td>
<td>51</td>
<td>2008/12/16</td>
<td>$164,500</td>
</tr>
<tr>
<td>Hope Fuentes</td>
<td>Secretary</td>
<td>San Francisco</td>
<td>41</td>
<td>2010/02/12</td>
<td>$109,850</td>
</tr>
<tr>
<td>Vivian Harrell</td>
<td>Financial Controller</td>
<td>San Francisco</td>
<td>62</td>
<td>2009/02/14</td>
<td>$452,500</td>
</tr>
<tr>
<td>Timothy Mooney</td>
<td>Office Manager</td>
<td>London</td>
<td>37</td>
<td>2008/12/11</td>
<td>$136,200</td>
</tr>
<tr>
<td>Jackson Bradshaw</td>
<td>Director</td>
<td>New York</td>
<td>65</td>
<td>2008/09/26</td>
<td>$645,750</td>
</tr>
<tr>
<td>Olivia Liang</td>
<td>Support Engineer</td>
<td>Singapore</td>
<td>64</td>
<td>2011/02/03</td>
<td>$234,500</td>
</tr>
<tr>
<td>Bruno Nash</td>
<td>Software Engineer</td>
<td>London</td>
<td>38</td>
<td>2011/05/03</td>
<td>$163,500</td>
</tr>
<tr>
<td>Sakura Yamamoto</td>
<td>Support Engineer</td>
<td>Tokyo</td>
<td>37</td>
<td>2009/08/19</td>
<td>$139,575</td>
</tr>
<tr>
<td>Thor Walton</td>
<td>Developer</td>
<td>New York</td>
<td>61</td>
<td>2013/08/11</td>
<td>$98,540</td>
</tr>
<tr>
<td>Finn Camacho</td>
<td>Support Engineer</td>
<td>San Francisco</td>
<td>47</td>
<td>2009/07/07</td>
<td>$87,500</td>
</tr>
<tr>
<td>Serge Baldwin</td>
<td>Data Coordinator</td>
<td>Singapore</td>
<td>64</td>
<td>2012/04/09</td>
<td>$138,575</td>
</tr>
<tr>
<td>Zenaida Frank</td>
<td>Software Engineer</td>
<td>New York</td>
<td>63</td>
<td>2010/01/04</td>
<td>$125,250</td>
</tr>
<tr>
<td>Zorita Serrano</td>
<td>Software Engineer</td>
<td>San Francisco</td>
<td>56</td>
<td>2012/06/01</td>
<td>$115,000</td>
</tr>
<tr>
<td>Jennifer Acosta</td>
<td>Junior Javascript Developer</td>
<td>Edinburgh</td>
<td>43</td>
<td>2013/02/01</td>
<td>$75,650</td>
</tr>
<tr>
<td>Cara Stevens</td>
<td>Sales Assistant</td>
<td>New York</td>
<td>46</td>
<td>2011/12/06</td>
<td>$145,600</td>
</tr>
<tr>
<td>Hermione Butler</td>
<td>Regional Director</td>
<td>London</td>
<td>47</td>
<td>2011/03/21</td>
<td>$356,250</td>
</tr>
<tr>
<td>Lael Greer</td>
<td>Systems Administrator</td>
<td>London</td>
<td>21</td>
<td>2009/02/27</td>
<td>$103,500</td>
</tr>
<tr>
<td>Jonas Alexander</td>
<td>Developer</td>
<td>San Francisco</td>
<td>30</td>
<td>2010/07/14</td>
<td>$86,500</td>
</tr>
<tr>
<td>Shad Decker</td>
<td>Regional Director</td>
<td>Edinburgh</td>
<td>51</td>
<td>2008/11/13</td>
<td>$183,000</td>
</tr>
<tr>
<td>Michael Bruce</td>
<td>Javascript Developer</td>
<td>Singapore</td>
<td>29</td>
<td>2011/06/27</td>
<td>$183,000</td>
</tr>
<tr>
<td>Donna Snider</td>
<td>Customer Support</td>
<td>New York</td>
<td>27</td>
<td>2011/01/25</td>
<td>$112,000</td>
</tr>
</tbody>
<tfoot>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
</div>
<p>The Javascript shown below is used to initialise the table shown in this example:</p>
<code class="multiline language-js">
$(document).ready(function() {
var table = $('#example').DataTable({
layout: {
top: 'lengthLinks'
}
});
} );
</code>
</div>
</section>
</body>
</html>

@ -7,19 +7,22 @@
* @author Allan Jardine
*
* This feature plug-in for DataTables adds page length control links to the
* DataTable. The `dom` option can be used to insert the control using the `L`
* character option and it uses the `lengthMenu` options of DataTables to
* determine what to display.
* DataTable. The `-init layout` option can be used to insert the control
* using the `lengthLinks` option.
*
* @example
* $('#myTable').DataTable( {
* dom: 'Lfrtip'
* layout: {
* topStart: 'lengthLinks;
* }
* } );
*
* @example
* $('#myTable').DataTable( {
* layout: {
* topStart: 'lengthLinks;
* },
* lengthMenu: [ [10, 25, 50, -1], [10, 25, 50, "All"] ]
* dom: 'Lfrtip'
* } );
*/
@ -30,12 +33,16 @@ declare module 'datatables.net' {
/** Page length control via links for DataTables */
LengthLinks(settings: any): void;
}
interface Feature {
lengthLinks?: {}
}
}
DataTable.LengthLinks = function (inst) {
var api = new DataTable.Api(inst);
var settings = api.settings()[0];
var container = $('<div></div>').addClass(settings.oClasses.sLength);
var container = $('<div></div>').addClass('dt-lengthLinks');
var lastLength: number | null = null;
// API so the feature wrapper can return the node to insert
@ -67,7 +74,9 @@ DataTable.LengthLinks = function (inst) {
});
container.html(
settings.oLanguage.sLengthMenu.replace('_MENU_', out.join(' | '))
settings.oLanguage.sLengthMenu
.replace('_MENU_', out.join(' | '))
.replace('_ENTRIES_', api.i18n('entries', '', 10))
);
lastLength = api.page.len();
});
@ -86,3 +95,8 @@ DataTable.ext.feature.push({
cFeature: 'L',
sFeature: 'LengthLinks',
});
DataTable.feature.register('lengthLinks', function (settings) {
var l = new DataTable.LengthLinks(settings);
return l.container();
});

@ -4,4 +4,4 @@
* Copyright (c) 20162020, Julian Kühnel, SpryMedia Ltd
* Released under the MIT license https://git.io/voRZ7
*****************************************************/
!function(n){var i,s;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(t){return n(t,window,document)}):"object"==typeof exports?(i=require("jquery"),s=function(t,e){e.fn.dataTable||require("datatables.net")(t,e)},"undefined"==typeof window?module.exports=function(t,e){return t=t||window,e=e||i(t),s(t,e),n(e,0,t.document)}:(s(window,i),module.exports=n(i,window,window.document))):n(jQuery,window,document)}(function(a,t,e,n){"use strict";var i=a.fn.dataTable;class s{instance;options;intervalThreshold;intervalMs;constructor(t,e){if(!a.fn.mark||!a.fn.unmark)throw new Error("jquery.mark.js is necessary for datatables.mark.js");this.instance=t,this.options="object"==typeof e?e:{},this.intervalThreshold=49,this.intervalMs=300,this.initMarkListener()}initMarkListener(){let t="draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth",e=(t+=" responsive-display.dt.dth",null);this.instance.on(t,()=>{this.instance.rows({filter:"applied",page:"current"}).nodes().length>this.intervalThreshold?(clearTimeout(e),e=setTimeout(()=>{this.mark()},this.intervalMs)):this.mark()}),this.instance.on("destroy",()=>{this.instance.off(t)}),this.mark()}mark(){const s=this.instance.search();var t=a(this.instance.table().body());t.unmark(this.options),this.instance.table().rows({search:"applied"}).data().length&&t.mark(s,this.options),this.instance.columns({search:"applied",page:"current"}).nodes().each((t,e)=>{const n=this.instance.column(e).search(),i=n||s;i&&t.forEach(t=>{a(t).unmark(this.options).mark(i,this.options)})})}}return a(e).on("init.dt.dth",(e,n)=>{if("dt"===e.namespace){e=new i.Api(n);let t=!1;e.init().mark?t=e.init().mark:i.defaults.mark&&(t=i.defaults.mark),t&&new s(e,t)}}),i});
!function(n){var i,s;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(t){return n(t,window,document)}):"object"==typeof exports?(i=require("jquery"),s=function(t,e){e.fn.dataTable||require("datatables.net")(t,e)},"undefined"==typeof window?module.exports=function(t,e){return t=t||window,e=e||i(t),s(t,e),n(e,0,t.document)}:(s(window,i),module.exports=n(i,window,window.document))):n(jQuery,window,document)}(function(a,t,e){"use strict";var i=a.fn.dataTable;class s{instance;options;intervalThreshold;intervalMs;constructor(t,e){if(!a.fn.mark||!a.fn.unmark)throw new Error("jquery.mark.js is necessary for datatables.mark.js");this.instance=t,this.options="object"==typeof e?e:{},this.intervalThreshold=49,this.intervalMs=300,this.initMarkListener()}initMarkListener(){let t="draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth",e=(t+=" responsive-display.dt.dth",null);this.instance.on(t,()=>{this.instance.rows({filter:"applied",page:"current"}).nodes().length>this.intervalThreshold?(clearTimeout(e),e=setTimeout(()=>{this.mark()},this.intervalMs)):this.mark()}),this.instance.on("destroy",()=>{this.instance.off(t)}),this.mark()}mark(){const s=this.instance.search();var t=a(this.instance.table().body());t.unmark(this.options),this.instance.table().rows({search:"applied"}).data().length&&t.mark(s,this.options),this.instance.columns({search:"applied",page:"current"}).nodes().each((t,e)=>{const n=this.instance.column(e).search(),i=n||s;i&&t.forEach(t=>{a(t).unmark(this.options).mark(i,this.options)})})}}return a(e).on("init.dt.dth",(e,n)=>{if("dt"===e.namespace){e=new i.Api(n);let t=!1;e.init().mark?t=e.init().mark:i.defaults.mark&&(t=i.defaults.mark),t&&new s(e,t)}}),i});

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */
!function(i){var o,s;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return i(e,window,document)}):"object"==typeof exports?(o=require("jquery"),s=function(e,t){t.fn.dataTable||require("datatables.net")(e,t)},"undefined"==typeof window?module.exports=function(e,t){return e=e||window,t=t||o(e),s(e,t),i(t,0,e.document)}:(s(window,o),module.exports=i(o,window,window.document))):i(jQuery,window,document)}(function(f,e,t,i){"use strict";function o(e,t){var i=e.table();this.s={dt:e,host:f(i.container()).parent(),header:f(i.header()),footer:f(i.footer()),body:f(i.body()),container:f(i.container()),table:f(i.node()),delta:t},this.sizes={offsetTop:this._getOffsetTop(),tableHeight:this._getTableHeight(),containerHeight:this._getContainerHeight(),headerHeight:this._getHeaderHeight(),footerHeight:this._getFooterHeight()};"static"===(i=this.s.host).css("position")&&i.css("position","relative");var o=function(){e.off(".pageResize",o),this.s.obj&&this.s.obj.remove()}.bind(this),s=(e.on("destroy.pageResize",o),this._attach(),"init.pageResize");e.on(s,function(){e.off(s),this._size()}.bind(this))}var s=f.fn.dataTable;return o.prototype={_size:function(){var e=this.s,t=e.dt,i=t.table(),o=f("tr",e.body),o=o.eq(1<o.length?1:0).height(),s=e.host.height(),n=i.header().parentNode!==i.body().parentNode,e=e.delta,a=this.sizes.offsetTop=this._getOffsetTop(),h=this.sizes.tableHeight=this._getTableHeight(),r=this.sizes.containerHeight=this._getContainerHeight(),g=this.sizes.headerHeight=this._getHeaderHeight(),d=this.sizes.footerHeight=this._getFooterHeight(),n=(n||(i.header()&&(s-=g),i.footer()&&(s-=d)),s=s-a-(r-(a+h)),!isNaN(parseFloat(e))&&isFinite(e)&&(s-=e),Math.floor(s/o));n!==1/0&&n!==-1/0&&!isNaN(n)&&0<n&&n!==t.page.len()&&t.page.len(n).draw()},_attach:function(){var o=this,e=f("<object/>").css({position:"absolute",top:0,left:0,height:"100%",width:"100%",zIndex:-1}).attr("type","text/html");e[0].onload=function(){var e=this.contentDocument,t=e.body,i=t.offsetHeight;e.defaultView.onresize=function(){var e=t.clientHeight||t.offsetHeight;e!==i?(i=e,o._size()):o.sizes.offsetTop===o._getOffsetTop()&&o.sizes.containerHeight===o._getContainerHeight()&&o.sizes.tableHeight===o._getTableHeight()&&o.sizes.headerHeight===o._getHeaderHeight()&&o.sizes.footerHeight===o._getFooterHeight()||o._size()}},e.appendTo(this.s.host).attr("data","about:blank"),this.s.obj=e},_getOffsetTop:function(){return f(this.s.table).offset().top},_getTableHeight:function(){return this.s.table.height()},_getContainerHeight:function(){return this.s.container.height()},_getHeaderHeight:function(){return this.s.dt.table().header()?this.s.header.height():0},_getFooterHeight:function(){return this.s.dt.table().footer()?this.s.footer.height():0}},s.PageResize=o,f(t).on("preInit.dt",function(e,t){"dt"===e.namespace&&(e=new s.Api(t),f(e.table().node()).hasClass("pageResize")||t.oInit.pageResize||s.defaults.pageResize)&&new o(e,t.oInit.pageResizeManualDelta)}),s});
!function(i){var o,s;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return i(e,window,document)}):"object"==typeof exports?(o=require("jquery"),s=function(e,t){t.fn.dataTable||require("datatables.net")(e,t)},"undefined"==typeof window?module.exports=function(e,t){return e=e||window,t=t||o(e),s(e,t),i(t,0,e.document)}:(s(window,o),module.exports=i(o,window,window.document))):i(jQuery,window,document)}(function(f,e,t){"use strict";function i(e,t){var i=e.table();this.s={dt:e,host:f(i.container()).parent(),header:f(i.header()),footer:f(i.footer()),body:f(i.body()),container:f(i.container()),table:f(i.node()),delta:t},this.sizes={offsetTop:this._getOffsetTop(),tableHeight:this._getTableHeight(),containerHeight:this._getContainerHeight(),headerHeight:this._getHeaderHeight(),footerHeight:this._getFooterHeight()};"static"===(i=this.s.host).css("position")&&i.css("position","relative");var o=function(){e.off(".pageResize",o),this.s.obj&&this.s.obj.remove()}.bind(this),s=(e.on("destroy.pageResize",o),this._attach(),"init.pageResize");e.on(s,function(){e.off(s),this._size()}.bind(this))}var o=f.fn.dataTable;return i.prototype={_size:function(){var e=this.s,t=e.dt,i=t.table(),o=f("tr",e.body),o=o.eq(1<o.length?1:0).height(),s=e.host.height(),n=i.header().parentNode!==i.body().parentNode,e=e.delta,a=this.sizes.offsetTop=this._getOffsetTop(),h=this.sizes.tableHeight=this._getTableHeight(),r=this.sizes.containerHeight=this._getContainerHeight(),g=this.sizes.headerHeight=this._getHeaderHeight(),d=this.sizes.footerHeight=this._getFooterHeight(),n=(n||(i.header()&&(s-=g),i.footer()&&(s-=d)),s=s-a-(r-(a+h)),!isNaN(parseFloat(e))&&isFinite(e)&&(s-=e),Math.floor(s/o));n!==1/0&&n!==-1/0&&!isNaN(n)&&0<n&&n!==t.page.len()&&t.page.len(n).draw()},_attach:function(){var o=this,e=f("<object/>").css({position:"absolute",top:0,left:0,height:"100%",width:"100%",zIndex:-1}).attr("type","text/html");e[0].onload=function(){var e=this.contentDocument,t=e.body,i=t.offsetHeight;e.defaultView.onresize=function(){var e=t.clientHeight||t.offsetHeight;e!==i?(i=e,o._size()):o.sizes.offsetTop===o._getOffsetTop()&&o.sizes.containerHeight===o._getContainerHeight()&&o.sizes.tableHeight===o._getTableHeight()&&o.sizes.headerHeight===o._getHeaderHeight()&&o.sizes.footerHeight===o._getFooterHeight()||o._size()}},e.appendTo(this.s.host).attr("data","about:blank"),this.s.obj=e},_getOffsetTop:function(){return f(this.s.table).offset().top},_getTableHeight:function(){return this.s.table.height()},_getContainerHeight:function(){return this.s.container.height()},_getHeaderHeight:function(){return this.s.dt.table().header()?this.s.header.height():0},_getFooterHeight:function(){return this.s.dt.table().footer()?this.s.footer.height():0}},o.PageResize=i,f(t).on("preInit.dt",function(e,t){"dt"===e.namespace&&(e=new o.Api(t),f(e.table().node()).hasClass("pageResize")||t.oInit.pageResize||o.defaults.pageResize)&&new i(e,t.oInit.pageResizeManualDelta)}),o});

@ -5,7 +5,7 @@
<title>DataTables page resize example</title>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/2.0.0/css/dataTables.dataTables.min.css">
<style type="text/css">
div.container {
margin: 0 auto;
@ -47,8 +47,8 @@
}
</style>
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/2.0.0/js/dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="dataTables.pageResize.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready( function () {

@ -5,7 +5,7 @@
<title>DataTables page resize example</title>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/2.0.0/css/dataTables.dataTables.min.css">
<style type="text/css">
div.container {
margin: 0 auto;
@ -47,8 +47,8 @@
}
</style>
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/2.0.0/js/dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="dataTables.pageResize.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready( function () {

@ -5,7 +5,7 @@
<title>DataTables page resize example</title>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/2.0.0/css/dataTables.dataTables.min.css">
<style type="text/css">
div.container {
margin: 0 auto;
@ -47,8 +47,8 @@
}
</style>
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/2.0.0/js/dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="dataTables.pageResize.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready( function () {

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */
!function(e){var o,d;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(n){return e(n,window,document)}):"object"==typeof exports?(o=require("jquery"),d=function(n,t){t.fn.dataTable||require("datatables.net")(n,t)},"undefined"==typeof window?module.exports=function(n,t){return n=n||window,t=t||o(n),d(n,t),e(t,0,n.document)}:(d(window,o),module.exports=e(o,window,window.document))):e(jQuery,window,document)}(function(r,n,t,e){"use strict";function o(n){var t=n.table();this.s={dt:n,body:r(t.body())},this._attach()}var d=r.fn.dataTable;return o.prototype={_attach:function(){var i=this.s.dt,a=this.s.body;i.on("draw",function(){var n=i.columns(":visible").count(),t=i.rows({page:"current"}).count(),e="even",o="odd";(t=0===t?1:t)%2==0&&(e="odd",o="even");for(var d=0;d<i.page.len()-t;d++)a.append(r('<tr><td colspan="'+n+'">&nbsp;</td></tr>').addClass(d%2==0?e:o).addClass("dt-rowFill--filler"))})}},d.RowFill=o,r(t).on("preInit.dt",function(n,t){"dt"===n.namespace&&(n=new d.Api(t),t.oInit.rowFill||d.defaults.rowFill)&&new o(n)}),d});
!function(e){var o,d;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(n){return e(n,window,document)}):"object"==typeof exports?(o=require("jquery"),d=function(n,t){t.fn.dataTable||require("datatables.net")(n,t)},"undefined"==typeof window?module.exports=function(n,t){return n=n||window,t=t||o(n),d(n,t),e(t,0,n.document)}:(d(window,o),module.exports=e(o,window,window.document))):e(jQuery,window,document)}(function(r,n,t){"use strict";function e(n){var t=n.table();this.s={dt:n,body:r(t.body())},this._attach()}var o=r.fn.dataTable;return e.prototype={_attach:function(){var i=this.s.dt,a=this.s.body;i.on("draw",function(){var n=i.columns(":visible").count(),t=i.rows({page:"current"}).count(),e="even",o="odd";(t=0===t?1:t)%2==0&&(e="odd",o="even");for(var d=0;d<i.page.len()-t;d++)a.append(r('<tr><td colspan="'+n+'">&nbsp;</td></tr>').addClass(d%2==0?e:o).addClass("dt-rowFill--filler"))})}},o.RowFill=e,r(t).on("preInit.dt",function(n,t){"dt"===n.namespace&&(n=new o.Api(t),t.oInit.rowFill||o.defaults.rowFill)&&new e(n)}),o});

@ -5,10 +5,10 @@
<title>DataTables row fill example</title>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/2.0.0/css/dataTables.dataTables.min.css">
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/2.0.0/js/dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="dataTables.rowFill.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready( function () {

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */
!function(o){var n,i;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(t){return o(t,window,document)}):"object"==typeof exports?(n=require("jquery"),i=function(t,e){e.fn.dataTable||require("datatables.net")(t,e)},"undefined"==typeof window?module.exports=function(t,e){return t=t||window,e=e||n(t),i(t,e),o(e,0,t.document)}:(i(window,n),module.exports=o(n,window,window.document))):o(jQuery,window,document)}(function(a,t,e,o){"use strict";function n(t){var e=this,o=t.table();this.s={dt:t,host:a(o.container()).parent(),header:a(o.header()),footer:a(o.footer()),body:a(o.body()),container:a(o.container()),table:a(o.node())};"static"===(o=this.s.host).css("position")&&o.css("position","relative"),t.on("draw.scrollResize",function(){e._size()}),t.on("destroy.scrollResize",function(){t.off(".scrollResize"),this.s.obj&&this.s.obj.remove()}.bind(this)),this._attach(),this._size();var o=t.settings()[0],n=(n=o.nScrollBody).scrollHeight>n.clientHeight;o.scrollBarVis&&!n&&t.columns.adjust()}var i=a.fn.dataTable;return n.prototype={_size:function(){var t=this.s,e=t.dt.table(),o=a(t.table).offset().top,n=t.host.height(),i=a("div.dataTables_scrollBody",e.container()),n=(n-=o)-(t.container.height()-(o+i.height()));a("div.dataTables_scrollBody",e.container()).css({maxHeight:n,height:n})},_attach:function(){var s=this,t=a("<iframe/>").css({position:"absolute",top:0,left:0,height:"100%",width:"100%",zIndex:-1,border:0}).attr("frameBorder","0").attr("src","about:blank");t[0].onload=function(){var t=this.contentDocument,o=t.body,n=o.offsetHeight,i=t;(i.defaultView||i.parentWindow).onresize=function(){var t=o.clientHeight||o.offsetHeight,e=i.documentElement.clientHeight;(t=!t&&e?e:t)!==n&&(n=t,s._size())}},t.appendTo(this.s.host).attr("data","about:blank"),this.s.obj=t}},i.ScrollResize=n,a(e).on("init.dt",function(t,e){"dt"===t.namespace&&(t=new i.Api(e),e.oInit.scrollResize||i.defaults.scrollResize)&&new n(t)}),i});
!function(o){var n,i;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(t){return o(t,window,document)}):"object"==typeof exports?(n=require("jquery"),i=function(t,e){e.fn.dataTable||require("datatables.net")(t,e)},"undefined"==typeof window?module.exports=function(t,e){return t=t||window,e=e||n(t),i(t,e),o(e,0,t.document)}:(i(window,n),module.exports=o(n,window,window.document))):o(jQuery,window,document)}(function(r,t,e){"use strict";function o(t){var e=this,o=t.table();this.s={dt:t,host:r(o.container()).parent(),header:r(o.header()),footer:r(o.footer()),body:r(o.body()),container:r(o.container()),table:r(o.node())};"static"===(o=this.s.host).css("position")&&o.css("position","relative"),t.on("draw.scrollResize",function(){e._size()}),t.on("destroy.scrollResize",function(){t.off(".scrollResize"),this.s.obj&&this.s.obj.remove()}.bind(this)),this._attach(),this._size();var o=t.settings()[0],n=(n=o.nScrollBody).scrollHeight>n.clientHeight;o.scrollBarVis&&!n&&t.columns.adjust()}var n=r.fn.dataTable;return o.prototype={_size:function(){var t=this.s,e=t.dt.table(),o=r(t.table).offset().top,n=t.host.height(),i=r("div.dt-scroll-body",e.container()),n=(n-=o)-(t.container.height()-(o+i.height()));r("div.dt-scroll-body",e.container()).css({maxHeight:n,height:n})},_attach:function(){var s=this,t=r("<iframe/>").css({position:"absolute",top:0,left:0,height:"100%",width:"100%",zIndex:-1,border:0}).attr("frameBorder","0").attr("src","about:blank");t[0].onload=function(){var t=this.contentDocument,o=t.body,n=o.offsetHeight,i=t;(i.defaultView||i.parentWindow).onresize=function(){var t=o.clientHeight||o.offsetHeight,e=i.documentElement.clientHeight;(t=!t&&e?e:t)!==n&&(n=t,s._size())}},t.appendTo(this.s.host).attr("data","about:blank"),this.s.obj=t}},n.ScrollResize=o,r(e).on("init.dt",function(t,e){"dt"===t.namespace&&(t=new n.Api(e),e.oInit.scrollResize||n.defaults.scrollResize)&&new o(t)}),n});

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */
import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;var ScrollResize=function(t){var e=this,o=t.table(),o=(this.s={dt:t,host:$(o.container()).parent(),header:$(o.header()),footer:$(o.footer()),body:$(o.body()),container:$(o.container()),table:$(o.node())},this.s.host),o=("static"===o.css("position")&&o.css("position","relative"),t.on("draw.scrollResize",function(){e._size()}),t.on("destroy.scrollResize",function(){t.off(".scrollResize"),this.s.obj&&this.s.obj.remove()}.bind(this)),this._attach(),this._size(),t.settings()[0]),i=o.nScrollBody,i=i.scrollHeight>i.clientHeight;o.scrollBarVis&&!i&&t.columns.adjust()};ScrollResize.prototype={_size:function(){var t=this.s,e=t.dt.table(),o=$(t.table).offset().top,i=t.host.height(),s=$("div.dataTables_scrollBody",e.container()),i=(i-=o)-(t.container.height()-(o+s.height()));$("div.dataTables_scrollBody",e.container()).css({maxHeight:i,height:i})},_attach:function(){var a=this,t=$("<iframe/>").css({position:"absolute",top:0,left:0,height:"100%",width:"100%",zIndex:-1,border:0}).attr("frameBorder","0").attr("src","about:blank");t[0].onload=function(){var t=this.contentDocument,o=t.body,i=o.offsetHeight,s=t;(s.defaultView||s.parentWindow).onresize=function(){var t=o.clientHeight||o.offsetHeight,e=s.documentElement.clientHeight;(t=!t&&e?e:t)!==i&&(i=t,a._size())}},t.appendTo(this.s.host).attr("data","about:blank"),this.s.obj=t}},DataTable.ScrollResize=ScrollResize,$(document).on("init.dt",function(t,e){"dt"===t.namespace&&(t=new DataTable.Api(e),e.oInit.scrollResize||DataTable.defaults.scrollResize)&&new ScrollResize(t)});export default DataTable;
import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;var ScrollResize=function(t){var e=this,o=t.table(),o=(this.s={dt:t,host:$(o.container()).parent(),header:$(o.header()),footer:$(o.footer()),body:$(o.body()),container:$(o.container()),table:$(o.node())},this.s.host),o=("static"===o.css("position")&&o.css("position","relative"),t.on("draw.scrollResize",function(){e._size()}),t.on("destroy.scrollResize",function(){t.off(".scrollResize"),this.s.obj&&this.s.obj.remove()}.bind(this)),this._attach(),this._size(),t.settings()[0]),i=o.nScrollBody,i=i.scrollHeight>i.clientHeight;o.scrollBarVis&&!i&&t.columns.adjust()};ScrollResize.prototype={_size:function(){var t=this.s,e=t.dt.table(),o=$(t.table).offset().top,i=t.host.height(),s=$("div.dt-scroll-body",e.container()),i=(i-=o)-(t.container.height()-(o+s.height()));$("div.dt-scroll-body",e.container()).css({maxHeight:i,height:i})},_attach:function(){var a=this,t=$("<iframe/>").css({position:"absolute",top:0,left:0,height:"100%",width:"100%",zIndex:-1,border:0}).attr("frameBorder","0").attr("src","about:blank");t[0].onload=function(){var t=this.contentDocument,o=t.body,i=o.offsetHeight,s=t;(s.defaultView||s.parentWindow).onresize=function(){var t=o.clientHeight||o.offsetHeight,e=s.documentElement.clientHeight;(t=!t&&e?e:t)!==i&&(i=t,a._size())}},t.appendTo(this.s.host).attr("data","about:blank"),this.s.obj=t}},DataTable.ScrollResize=ScrollResize,$(document).on("init.dt",function(t,e){"dt"===t.namespace&&(t=new DataTable.Api(e),e.oInit.scrollResize||DataTable.defaults.scrollResize)&&new ScrollResize(t)});export default DataTable;

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */
!function(o){var t,i;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return o(e,window,document)}):"object"==typeof exports?(t=require("jquery"),i=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"==typeof window?module.exports=function(e,n){return e=e||window,n=n||t(e),i(e,n),o(n,0,e.document)}:(i(window,t),module.exports=o(t,window,window.document))):o(jQuery,window,document)}(function(t,e,i,n){"use strict";var u=t.fn.dataTable;return t(i).on("preInit.dt",function(e,n){var o;"dt"===e.namespace&&(n.oInit.scrollToTop||u.defaults.scrollToTop)&&(o=new u.Api(n)).on("page",function(){setTimeout(function(){t(i).scrollTop(t(o.table().container()).offset().top)},10)})}),u});
!function(o){var t,i;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return o(e,window,document)}):"object"==typeof exports?(t=require("jquery"),i=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"==typeof window?module.exports=function(e,n){return e=e||window,n=n||t(e),i(e,n),o(n,0,e.document)}:(i(window,t),module.exports=o(t,window,window.document))):o(jQuery,window,document)}(function(t,e,i){"use strict";var u=t.fn.dataTable;return t(i).on("preInit.dt",function(e,n){var o;"dt"===e.namespace&&(n.oInit.scrollToTop||u.defaults.scrollToTop)&&(o=new u.Api(n)).on("page",function(){setTimeout(function(){t(i).scrollTop(t(o.table().container()).offset().top)},10)})}),u});

@ -16,5 +16,8 @@ declare module 'datatables.net' {
interface ApiSearchFadeMethods<T> extends Api<T> {
node(): JQuery | null;
}
interface Feature {
searchFade?: {};
}
}
export {};

@ -53,11 +53,14 @@ var DataTable = $.fn.dataTable;
* This source file is free software, available under the following license:
* MIT license - http://datatables.net/license/mit
*
* This source file is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
* This feature will fade out rows which don't match from the input
*
* For details please refer to: http://www.datatables.net
* @example
* $('#myTable').DataTable( {
* layout: {
* topStart: 'searchFade;
* }
* } );
*/
DataTable.Api.register('searchFade()', function () {
return this;
@ -108,6 +111,10 @@ DataTable.ext.feature.push({
},
cFeature: 'F',
});
DataTable.feature.register('searchFade', function (settings) {
var search = new DataTable.SearchFade(settings);
return search.node();
});
$(document).on('init.dt', function (e, settings) {
if (e.namespace !== 'dt') {
return;

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */
!function(t){var a,r;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(a=require("jquery"),r=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"==typeof window?module.exports=function(e,n){return e=e||window,n=n||a(e),r(e,n),t(n,0,e.document)}:(r(window,a),module.exports=t(a,window,window.document))):t(jQuery,window,document)}(function(i,e,n,t){"use strict";var a=i.fn.dataTable;return a.Api.register("searchFade()",function(){return this}),a.Api.register("searchFade().node()",function(){return this.settings()[0].searchFadeNode}),a.SearchFade=function(e){var n,d=new a.Api(e),t=i('<div class="searchFade"/>');d.settings()[0].searchFadeNode=t,e=d,(n=t).empty(),n.append("Search: "),i('<input type="text" class="searchFadeInput'+e.settings()[0].sTableId+'">').appendTo(n),t.on("keyup redraw","input",function(){d.rows(":visible").every(function(e,n,t){var a=!0,r=i(".searchFadeInput"+d.settings()[0].sTableId).val();r.length&&(a=d.row(e).data().some(function(e){return null!=e.match(new RegExp(r,"i"))})),i(d.row(e).node()).toggleClass("notMatched",!a)})}),d.on("draw",function(){i("input",t).trigger("redraw")}),this.node=function(){return t}},a.ext.feature.push({fnInit:function(e){return new a.SearchFade(e).node()},cFeature:"F"}),i(n).on("init.dt",function(e,n){"dt"===e.namespace&&(n.oInit.searchFade||a.defaults.searchFade)&&a.SearchFade(n)}),a});
!function(t){var r,a;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(r=require("jquery"),a=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"==typeof window?module.exports=function(e,n){return e=e||window,n=n||r(e),a(e,n),t(n,0,e.document)}:(a(window,r),module.exports=t(r,window,window.document))):t(jQuery,window,document)}(function(i,e,n){"use strict";var r=i.fn.dataTable;return r.Api.register("searchFade()",function(){return this}),r.Api.register("searchFade().node()",function(){return this.settings()[0].searchFadeNode}),r.SearchFade=function(e){var n,d=new r.Api(e),t=i('<div class="searchFade"/>');d.settings()[0].searchFadeNode=t,e=d,(n=t).empty(),n.append("Search: "),i('<input type="text" class="searchFadeInput'+e.settings()[0].sTableId+'">').appendTo(n),t.on("keyup redraw","input",function(){d.rows(":visible").every(function(e,n,t){var r=!0,a=i(".searchFadeInput"+d.settings()[0].sTableId).val();a.length&&(r=d.row(e).data().some(function(e){return null!=e.match(new RegExp(a,"i"))})),i(d.row(e).node()).toggleClass("notMatched",!r)})}),d.on("draw",function(){i("input",t).trigger("redraw")}),this.node=function(){return t}},r.ext.feature.push({fnInit:function(e){return new r.SearchFade(e).node()},cFeature:"F"}),r.feature.register("searchFade",function(e){return new r.SearchFade(e).node()}),i(n).on("init.dt",function(e,n){"dt"===e.namespace&&(n.oInit.searchFade||r.defaults.searchFade)&&r.SearchFade(n)}),r});

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */
import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;function _draw(e,a){a.empty(),a.append("Search: "),$('<input type="text" class="searchFadeInput'+e.settings()[0].sTableId+'">').appendTo(a)}DataTable.Api.register("searchFade()",function(){return this}),DataTable.Api.register("searchFade().node()",function(){return this.settings()[0].searchFadeNode}),DataTable.SearchFade=function(e){var i=new DataTable.Api(e),a=$('<div class="searchFade"/>');i.settings()[0].searchFadeNode=a,_draw(i,a),a.on("keyup redraw","input",function(){i.rows(":visible").every(function(e,a,t){var n=!0,r=$(".searchFadeInput"+i.settings()[0].sTableId).val();r.length&&(n=i.row(e).data().some(function(e){return null!=e.match(new RegExp(r,"i"))})),$(i.row(e).node()).toggleClass("notMatched",!n)})}),i.on("draw",function(){$("input",a).trigger("redraw")}),this.node=function(){return a}},DataTable.ext.feature.push({fnInit:function(e){return new DataTable.SearchFade(e).node()},cFeature:"F"}),$(document).on("init.dt",function(e,a){"dt"===e.namespace&&(a.oInit.searchFade||DataTable.defaults.searchFade)&&DataTable.SearchFade(a)});export default DataTable;
import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;function _draw(e,a){a.empty(),a.append("Search: "),$('<input type="text" class="searchFadeInput'+e.settings()[0].sTableId+'">').appendTo(a)}DataTable.Api.register("searchFade()",function(){return this}),DataTable.Api.register("searchFade().node()",function(){return this.settings()[0].searchFadeNode}),DataTable.SearchFade=function(e){var d=new DataTable.Api(e),a=$('<div class="searchFade"/>');d.settings()[0].searchFadeNode=a,_draw(d,a),a.on("keyup redraw","input",function(){d.rows(":visible").every(function(e,a,t){var n=!0,r=$(".searchFadeInput"+d.settings()[0].sTableId).val();r.length&&(n=d.row(e).data().some(function(e){return null!=e.match(new RegExp(r,"i"))})),$(d.row(e).node()).toggleClass("notMatched",!n)})}),d.on("draw",function(){$("input",a).trigger("redraw")}),this.node=function(){return a}},DataTable.ext.feature.push({fnInit:function(e){return new DataTable.SearchFade(e).node()},cFeature:"F"}),DataTable.feature.register("searchFade",function(e){return new DataTable.SearchFade(e).node()}),$(document).on("init.dt",function(e,a){"dt"===e.namespace&&(a.oInit.searchFade||DataTable.defaults.searchFade)&&DataTable.SearchFade(a)});export default DataTable;

@ -13,11 +13,14 @@ let $ = jQuery;
* This source file is free software, available under the following license:
* MIT license - http://datatables.net/license/mit
*
* This source file is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
* This feature will fade out rows which don't match from the input
*
* For details please refer to: http://www.datatables.net
* @example
* $('#myTable').DataTable( {
* layout: {
* topStart: 'searchFade;
* }
* } );
*/
DataTable.Api.register('searchFade()', function () {
return this;
@ -68,6 +71,10 @@ DataTable.ext.feature.push({
},
cFeature: 'F',
});
DataTable.feature.register('searchFade', function (settings) {
var search = new DataTable.SearchFade(settings);
return search.node();
});
$(document).on('init.dt', function (e, settings) {
if (e.namespace !== 'dt') {
return;

@ -0,0 +1,529 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0, user-scalable=no">
<title>DataTables example - Fuzzy Searching</title>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/2.0.0/css/dataTables.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="dataTables.searchFade.css">
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-3.7.1.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/2.0.0/js/dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="dataTables.searchFade.js"></script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() {
var table = $('#example').DataTable({
layout: {
topEnd: 'searchFade'
}
});
} );
</script>
</head>
<body class="dt-example">
<div class="container">
<section>
<h1>DataTables example <span>SearchFade</span></h1>
<div class="info">
</div>
<div class="demo-html">
<table id="example" class="display" style="width:100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tbody>
<tr>
<td>Tiger Nixon</td>
<td>System Architect</td>
<td>Edinburgh</td>
<td>61</td>
<td>2011/04/25</td>
<td>$320,800</td>
</tr>
<tr>
<td>Garrett Winters</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>63</td>
<td>2011/07/25</td>
<td>$170,750</td>
</tr>
<tr>
<td>Ashton Cox</td>
<td>Junior Technical Author</td>
<td>San Francisco</td>
<td>66</td>
<td>2009/01/12</td>
<td>$86,000</td>
</tr>
<tr>
<td>Cedric Kelly</td>
<td>Senior Javascript Developer</td>
<td>Edinburgh</td>
<td>22</td>
<td>2012/03/29</td>
<td>$433,060</td>
</tr>
<tr>
<td>Airi Satou</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>33</td>
<td>2008/11/28</td>
<td>$162,700</td>
</tr>
<tr>
<td>Brielle Williamson</td>
<td>Integration Specialist</td>
<td>New York</td>
<td>61</td>
<td>2012/12/02</td>
<td>$372,000</td>
</tr>
<tr>
<td>Herrod Chandler</td>
<td>Sales Assistant</td>
<td>San Francisco</td>
<td>59</td>
<td>2012/08/06</td>
<td>$137,500</td>
</tr>
<tr>
<td>Rhona Davidson</td>
<td>Integration Specialist</td>
<td>Tokyo</td>
<td>55</td>
<td>2010/10/14</td>
<td>$327,900</td>
</tr>
<tr>
<td>Colleen Hurst</td>
<td>Javascript Developer</td>
<td>San Francisco</td>
<td>39</td>
<td>2009/09/15</td>
<td>$205,500</td>
</tr>
<tr>
<td>Sonya Frost</td>
<td>Software Engineer</td>
<td>Edinburgh</td>
<td>23</td>
<td>2008/12/13</td>
<td>$103,600</td>
</tr>
<tr>
<td>Jena Gaines</td>
<td>Office Manager</td>
<td>London</td>
<td>30</td>
<td>2008/12/19</td>
<td>$90,560</td>
</tr>
<tr>
<td>Quinn Flynn</td>
<td>Support Lead</td>
<td>Edinburgh</td>
<td>22</td>
<td>2013/03/03</td>
<td>$342,000</td>
</tr>
<tr>
<td>Charde Marshall</td>
<td>Regional Director</td>
<td>San Francisco</td>
<td>36</td>
<td>2008/10/16</td>
<td>$470,600</td>
</tr>
<tr>
<td>Haley Kennedy</td>
<td>Senior Marketing Designer</td>
<td>London</td>
<td>43</td>
<td>2012/12/18</td>
<td>$313,500</td>
</tr>
<tr>
<td>Tatyana Fitzpatrick</td>
<td>Regional Director</td>
<td>London</td>
<td>19</td>
<td>2010/03/17</td>
<td>$385,750</td>
</tr>
<tr>
<td>Michael Silva</td>
<td>Marketing Designer</td>
<td>London</td>
<td>66</td>
<td>2012/11/27</td>
<td>$198,500</td>
</tr>
<tr>
<td>Paul Byrd</td>
<td>Chief Financial Officer (CFO)</td>
<td>New York</td>
<td>64</td>
<td>2010/06/09</td>
<td>$725,000</td>
</tr>
<tr>
<td>Gloria Little</td>
<td>Systems Administrator</td>
<td>New York</td>
<td>59</td>
<td>2009/04/10</td>
<td>$237,500</td>
</tr>
<tr>
<td>Bradley Greer</td>
<td>Software Engineer</td>
<td>London</td>
<td>41</td>
<td>2012/10/13</td>
<td>$132,000</td>
</tr>
<tr>
<td>Dai Rios</td>
<td>Personnel Lead</td>
<td>Edinburgh</td>
<td>35</td>
<td>2012/09/26</td>
<td>$217,500</td>
</tr>
<tr>
<td>Jenette Caldwell</td>
<td>Development Lead</td>
<td>New York</td>
<td>30</td>
<td>2011/09/03</td>
<td>$345,000</td>
</tr>
<tr>
<td>Yuri Berry</td>
<td>Chief Marketing Officer (CMO)</td>
<td>New York</td>
<td>40</td>
<td>2009/06/25</td>
<td>$675,000</td>
</tr>
<tr>
<td>Caesar Vance</td>
<td>Pre-Sales Support</td>
<td>New York</td>
<td>21</td>
<td>2011/12/12</td>
<td>$106,450</td>
</tr>
<tr>
<td>Doris Wilder</td>
<td>Sales Assistant</td>
<td>Sydney</td>
<td>23</td>
<td>2010/09/20</td>
<td>$85,600</td>
</tr>
<tr>
<td>Angelica Ramos</td>
<td>Chief Executive Officer (CEO)</td>
<td>London</td>
<td>47</td>
<td>2009/10/09</td>
<td>$1,200,000</td>
</tr>
<tr>
<td>Gavin Joyce</td>
<td>Developer</td>
<td>Edinburgh</td>
<td>42</td>
<td>2010/12/22</td>
<td>$92,575</td>
</tr>
<tr>
<td>Jennifer Chang</td>
<td>Regional Director</td>
<td>Singapore</td>
<td>28</td>
<td>2010/11/14</td>
<td>$357,650</td>
</tr>
<tr>
<td>Brenden Wagner</td>
<td>Software Engineer</td>
<td>San Francisco</td>
<td>28</td>
<td>2011/06/07</td>
<td>$206,850</td>
</tr>
<tr>
<td>Fiona Green</td>
<td>Chief Operating Officer (COO)</td>
<td>San Francisco</td>
<td>48</td>
<td>2010/03/11</td>
<td>$850,000</td>
</tr>
<tr>
<td>Shou Itou</td>
<td>Regional Marketing</td>
<td>Tokyo</td>
<td>20</td>
<td>2011/08/14</td>
<td>$163,000</td>
</tr>
<tr>
<td>Michelle House</td>
<td>Integration Specialist</td>
<td>Sydney</td>
<td>37</td>
<td>2011/06/02</td>
<td>$95,400</td>
</tr>
<tr>
<td>Suki Burks</td>
<td>Developer</td>
<td>London</td>
<td>53</td>
<td>2009/10/22</td>
<td>$114,500</td>
</tr>
<tr>
<td>Prescott Bartlett</td>
<td>Technical Author</td>
<td>London</td>
<td>27</td>
<td>2011/05/07</td>
<td>$145,000</td>
</tr>
<tr>
<td>Gavin Cortez</td>
<td>Team Leader</td>
<td>San Francisco</td>
<td>22</td>
<td>2008/10/26</td>
<td>$235,500</td>
</tr>
<tr>
<td>Martena Mccray</td>
<td>Post-Sales support</td>
<td>Edinburgh</td>
<td>46</td>
<td>2011/03/09</td>
<td>$324,050</td>
</tr>
<tr>
<td>Unity Butler</td>
<td>Marketing Designer</td>
<td>San Francisco</td>
<td>47</td>
<td>2009/12/09</td>
<td>$85,675</td>
</tr>
<tr>
<td>Howard Hatfield</td>
<td>Office Manager</td>
<td>San Francisco</td>
<td>51</td>
<td>2008/12/16</td>
<td>$164,500</td>
</tr>
<tr>
<td>Hope Fuentes</td>
<td>Secretary</td>
<td>San Francisco</td>
<td>41</td>
<td>2010/02/12</td>
<td>$109,850</td>
</tr>
<tr>
<td>Vivian Harrell</td>
<td>Financial Controller</td>
<td>San Francisco</td>
<td>62</td>
<td>2009/02/14</td>
<td>$452,500</td>
</tr>
<tr>
<td>Timothy Mooney</td>
<td>Office Manager</td>
<td>London</td>
<td>37</td>
<td>2008/12/11</td>
<td>$136,200</td>
</tr>
<tr>
<td>Jackson Bradshaw</td>
<td>Director</td>
<td>New York</td>
<td>65</td>
<td>2008/09/26</td>
<td>$645,750</td>
</tr>
<tr>
<td>Olivia Liang</td>
<td>Support Engineer</td>
<td>Singapore</td>
<td>64</td>
<td>2011/02/03</td>
<td>$234,500</td>
</tr>
<tr>
<td>Bruno Nash</td>
<td>Software Engineer</td>
<td>London</td>
<td>38</td>
<td>2011/05/03</td>
<td>$163,500</td>
</tr>
<tr>
<td>Sakura Yamamoto</td>
<td>Support Engineer</td>
<td>Tokyo</td>
<td>37</td>
<td>2009/08/19</td>
<td>$139,575</td>
</tr>
<tr>
<td>Thor Walton</td>
<td>Developer</td>
<td>New York</td>
<td>61</td>
<td>2013/08/11</td>
<td>$98,540</td>
</tr>
<tr>
<td>Finn Camacho</td>
<td>Support Engineer</td>
<td>San Francisco</td>
<td>47</td>
<td>2009/07/07</td>
<td>$87,500</td>
</tr>
<tr>
<td>Serge Baldwin</td>
<td>Data Coordinator</td>
<td>Singapore</td>
<td>64</td>
<td>2012/04/09</td>
<td>$138,575</td>
</tr>
<tr>
<td>Zenaida Frank</td>
<td>Software Engineer</td>
<td>New York</td>
<td>63</td>
<td>2010/01/04</td>
<td>$125,250</td>
</tr>
<tr>
<td>Zorita Serrano</td>
<td>Software Engineer</td>
<td>San Francisco</td>
<td>56</td>
<td>2012/06/01</td>
<td>$115,000</td>
</tr>
<tr>
<td>Jennifer Acosta</td>
<td>Junior Javascript Developer</td>
<td>Edinburgh</td>
<td>43</td>
<td>2013/02/01</td>
<td>$75,650</td>
</tr>
<tr>
<td>Cara Stevens</td>
<td>Sales Assistant</td>
<td>New York</td>
<td>46</td>
<td>2011/12/06</td>
<td>$145,600</td>
</tr>
<tr>
<td>Hermione Butler</td>
<td>Regional Director</td>
<td>London</td>
<td>47</td>
<td>2011/03/21</td>
<td>$356,250</td>
</tr>
<tr>
<td>Lael Greer</td>
<td>Systems Administrator</td>
<td>London</td>
<td>21</td>
<td>2009/02/27</td>
<td>$103,500</td>
</tr>
<tr>
<td>Jonas Alexander</td>
<td>Developer</td>
<td>San Francisco</td>
<td>30</td>
<td>2010/07/14</td>
<td>$86,500</td>
</tr>
<tr>
<td>Shad Decker</td>
<td>Regional Director</td>
<td>Edinburgh</td>
<td>51</td>
<td>2008/11/13</td>
<td>$183,000</td>
</tr>
<tr>
<td>Michael Bruce</td>
<td>Javascript Developer</td>
<td>Singapore</td>
<td>29</td>
<td>2011/06/27</td>
<td>$183,000</td>
</tr>
<tr>
<td>Donna Snider</td>
<td>Customer Support</td>
<td>New York</td>
<td>27</td>
<td>2011/01/25</td>
<td>$112,000</td>
</tr>
</tbody>
<tfoot>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
</div>
<p>The Javascript shown below is used to initialise the table shown in this example:</p>
<code class="multiline language-js">
$(document).ready(function() {
var table = $('#example').DataTable({
layout: {
topEnd: 'searchFade'
}
});
} );</code>
</div>
</section>
</body>
</html>

@ -7,11 +7,14 @@
* This source file is free software, available under the following license:
* MIT license - http://datatables.net/license/mit
*
* This source file is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
*
* For details please refer to: http://www.datatables.net
* This feature will fade out rows which don't match from the input
*
* @example
* $('#myTable').DataTable( {
* layout: {
* topStart: 'searchFade;
* }
* } );
*/
import $ from 'jquery';
@ -38,6 +41,10 @@ declare module 'datatables.net' {
interface ApiSearchFadeMethods<T> extends Api<T> {
node(): JQuery | null;
}
interface Feature {
searchFade?: {}
}
}
DataTable.Api.register('searchFade()', function () {
@ -105,6 +112,12 @@ DataTable.ext.feature.push({
cFeature: 'F',
});
DataTable.feature.register('searchFade', function (settings) {
var search = new DataTable.SearchFade(settings);
return search.node();
});
$(document).on('init.dt', function (e, settings) {
if (e.namespace !== 'dt') {
return;

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */
!function(n){var i,o;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(t){return n(t,window,document)}):"object"==typeof exports?(i=require("jquery"),o=function(t,e){e.fn.dataTable||require("datatables.net")(t,e)},"undefined"==typeof window?module.exports=function(t,e){return t=t||window,e=e||i(t),o(t,e),n(e,0,t.document)}:(o(window,i),module.exports=n(i,window,window.document))):n(jQuery,window,document)}(function(d,t,e,n){"use strict";var a=d.fn.dataTable;function r(t,e){t.unhighlight(),e.rows({filter:"applied"}).data().length&&(e.columns().every(function(){var t=this;t.nodes().flatten().to$().unhighlight({className:"column_highlight"}),t.nodes().flatten().to$().highlight(t.search().trim().split(/\s+/),{className:"column_highlight"})}),t.highlight(e.search().trim().split(/\s+/)))}return d(e).on("init.dt.dth",function(t,e,n){var i,o;"dt"===t.namespace&&(i=new a.Api(e),o=d(i.table().body()),d(i.table().node()).hasClass("searchHighlight")||e.oInit.searchHighlight||a.defaults.searchHighlight)&&(i.on("draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth",function(){r(o,i)}).on("destroy",function(){i.off("draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth")}),i.search())&&r(o,i)}),a});
!function(n){var i,o;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(t){return n(t,window,document)}):"object"==typeof exports?(i=require("jquery"),o=function(t,e){e.fn.dataTable||require("datatables.net")(t,e)},"undefined"==typeof window?module.exports=function(t,e){return t=t||window,e=e||i(t),o(t,e),n(e,0,t.document)}:(o(window,i),module.exports=n(i,window,window.document))):n(jQuery,window,document)}(function(d,t,e){"use strict";var a=d.fn.dataTable;function r(t,e){t.unhighlight(),e.rows({filter:"applied"}).data().length&&(e.columns().every(function(){var t=this;t.nodes().flatten().to$().unhighlight({className:"column_highlight"}),t.nodes().flatten().to$().highlight(t.search().trim().split(/\s+/),{className:"column_highlight"})}),t.highlight(e.search().trim().split(/\s+/)))}return d(e).on("init.dt.dth",function(t,e,n){var i,o;"dt"===t.namespace&&(i=new a.Api(e),o=d(i.table().body()),d(i.table().node()).hasClass("searchHighlight")||e.oInit.searchHighlight||a.defaults.searchHighlight)&&(i.on("draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth",function(){r(o,i)}).on("destroy",function(){i.off("draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth")}),i.search())&&r(o,i)}),a});

@ -0,0 +1,524 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0, user-scalable=no">
<title>DataTables example - Fuzzy Searching</title>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/2.0.0/css/dataTables.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="dataTables.searchHighlight.css">
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-3.7.1.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/2.0.0/js/dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src=" http://bartaz.github.io/sandbox.js/jquery.highlight.js"></script>
<script type="text/javascript" language="javascript" src="dataTables.searchHighlight.js"></script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() {
var table = $('#example').DataTable({
searchHighlight: true
});
} );
</script>
</head>
<body class="dt-example">
<div class="container">
<section>
<h1>DataTables example <span>Search Highlight</span></h1>
<div class="info">
</div>
<div class="demo-html">
<table id="example" class="display" style="width:100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tbody>
<tr>
<td>Tiger Nixon</td>
<td>System Architect</td>
<td>Edinburgh</td>
<td>61</td>
<td>2011/04/25</td>
<td>$320,800</td>
</tr>
<tr>
<td>Garrett Winters</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>63</td>
<td>2011/07/25</td>
<td>$170,750</td>
</tr>
<tr>
<td>Ashton Cox</td>
<td>Junior Technical Author</td>
<td>San Francisco</td>
<td>66</td>
<td>2009/01/12</td>
<td>$86,000</td>
</tr>
<tr>
<td>Cedric Kelly</td>
<td>Senior Javascript Developer</td>
<td>Edinburgh</td>
<td>22</td>
<td>2012/03/29</td>
<td>$433,060</td>
</tr>
<tr>
<td>Airi Satou</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>33</td>
<td>2008/11/28</td>
<td>$162,700</td>
</tr>
<tr>
<td>Brielle Williamson</td>
<td>Integration Specialist</td>
<td>New York</td>
<td>61</td>
<td>2012/12/02</td>
<td>$372,000</td>
</tr>
<tr>
<td>Herrod Chandler</td>
<td>Sales Assistant</td>
<td>San Francisco</td>
<td>59</td>
<td>2012/08/06</td>
<td>$137,500</td>
</tr>
<tr>
<td>Rhona Davidson</td>
<td>Integration Specialist</td>
<td>Tokyo</td>
<td>55</td>
<td>2010/10/14</td>
<td>$327,900</td>
</tr>
<tr>
<td>Colleen Hurst</td>
<td>Javascript Developer</td>
<td>San Francisco</td>
<td>39</td>
<td>2009/09/15</td>
<td>$205,500</td>
</tr>
<tr>
<td>Sonya Frost</td>
<td>Software Engineer</td>
<td>Edinburgh</td>
<td>23</td>
<td>2008/12/13</td>
<td>$103,600</td>
</tr>
<tr>
<td>Jena Gaines</td>
<td>Office Manager</td>
<td>London</td>
<td>30</td>
<td>2008/12/19</td>
<td>$90,560</td>
</tr>
<tr>
<td>Quinn Flynn</td>
<td>Support Lead</td>
<td>Edinburgh</td>
<td>22</td>
<td>2013/03/03</td>
<td>$342,000</td>
</tr>
<tr>
<td>Charde Marshall</td>
<td>Regional Director</td>
<td>San Francisco</td>
<td>36</td>
<td>2008/10/16</td>
<td>$470,600</td>
</tr>
<tr>
<td>Haley Kennedy</td>
<td>Senior Marketing Designer</td>
<td>London</td>
<td>43</td>
<td>2012/12/18</td>
<td>$313,500</td>
</tr>
<tr>
<td>Tatyana Fitzpatrick</td>
<td>Regional Director</td>
<td>London</td>
<td>19</td>
<td>2010/03/17</td>
<td>$385,750</td>
</tr>
<tr>
<td>Michael Silva</td>
<td>Marketing Designer</td>
<td>London</td>
<td>66</td>
<td>2012/11/27</td>
<td>$198,500</td>
</tr>
<tr>
<td>Paul Byrd</td>
<td>Chief Financial Officer (CFO)</td>
<td>New York</td>
<td>64</td>
<td>2010/06/09</td>
<td>$725,000</td>
</tr>
<tr>
<td>Gloria Little</td>
<td>Systems Administrator</td>
<td>New York</td>
<td>59</td>
<td>2009/04/10</td>
<td>$237,500</td>
</tr>
<tr>
<td>Bradley Greer</td>
<td>Software Engineer</td>
<td>London</td>
<td>41</td>
<td>2012/10/13</td>
<td>$132,000</td>
</tr>
<tr>
<td>Dai Rios</td>
<td>Personnel Lead</td>
<td>Edinburgh</td>
<td>35</td>
<td>2012/09/26</td>
<td>$217,500</td>
</tr>
<tr>
<td>Jenette Caldwell</td>
<td>Development Lead</td>
<td>New York</td>
<td>30</td>
<td>2011/09/03</td>
<td>$345,000</td>
</tr>
<tr>
<td>Yuri Berry</td>
<td>Chief Marketing Officer (CMO)</td>
<td>New York</td>
<td>40</td>
<td>2009/06/25</td>
<td>$675,000</td>
</tr>
<tr>
<td>Caesar Vance</td>
<td>Pre-Sales Support</td>
<td>New York</td>
<td>21</td>
<td>2011/12/12</td>
<td>$106,450</td>
</tr>
<tr>
<td>Doris Wilder</td>
<td>Sales Assistant</td>
<td>Sydney</td>
<td>23</td>
<td>2010/09/20</td>
<td>$85,600</td>
</tr>
<tr>
<td>Angelica Ramos</td>
<td>Chief Executive Officer (CEO)</td>
<td>London</td>
<td>47</td>
<td>2009/10/09</td>
<td>$1,200,000</td>
</tr>
<tr>
<td>Gavin Joyce</td>
<td>Developer</td>
<td>Edinburgh</td>
<td>42</td>
<td>2010/12/22</td>
<td>$92,575</td>
</tr>
<tr>
<td>Jennifer Chang</td>
<td>Regional Director</td>
<td>Singapore</td>
<td>28</td>
<td>2010/11/14</td>
<td>$357,650</td>
</tr>
<tr>
<td>Brenden Wagner</td>
<td>Software Engineer</td>
<td>San Francisco</td>
<td>28</td>
<td>2011/06/07</td>
<td>$206,850</td>
</tr>
<tr>
<td>Fiona Green</td>
<td>Chief Operating Officer (COO)</td>
<td>San Francisco</td>
<td>48</td>
<td>2010/03/11</td>
<td>$850,000</td>
</tr>
<tr>
<td>Shou Itou</td>
<td>Regional Marketing</td>
<td>Tokyo</td>
<td>20</td>
<td>2011/08/14</td>
<td>$163,000</td>
</tr>
<tr>
<td>Michelle House</td>
<td>Integration Specialist</td>
<td>Sydney</td>
<td>37</td>
<td>2011/06/02</td>
<td>$95,400</td>
</tr>
<tr>
<td>Suki Burks</td>
<td>Developer</td>
<td>London</td>
<td>53</td>
<td>2009/10/22</td>
<td>$114,500</td>
</tr>
<tr>
<td>Prescott Bartlett</td>
<td>Technical Author</td>
<td>London</td>
<td>27</td>
<td>2011/05/07</td>
<td>$145,000</td>
</tr>
<tr>
<td>Gavin Cortez</td>
<td>Team Leader</td>
<td>San Francisco</td>
<td>22</td>
<td>2008/10/26</td>
<td>$235,500</td>
</tr>
<tr>
<td>Martena Mccray</td>
<td>Post-Sales support</td>
<td>Edinburgh</td>
<td>46</td>
<td>2011/03/09</td>
<td>$324,050</td>
</tr>
<tr>
<td>Unity Butler</td>
<td>Marketing Designer</td>
<td>San Francisco</td>
<td>47</td>
<td>2009/12/09</td>
<td>$85,675</td>
</tr>
<tr>
<td>Howard Hatfield</td>
<td>Office Manager</td>
<td>San Francisco</td>
<td>51</td>
<td>2008/12/16</td>
<td>$164,500</td>
</tr>
<tr>
<td>Hope Fuentes</td>
<td>Secretary</td>
<td>San Francisco</td>
<td>41</td>
<td>2010/02/12</td>
<td>$109,850</td>
</tr>
<tr>
<td>Vivian Harrell</td>
<td>Financial Controller</td>
<td>San Francisco</td>
<td>62</td>
<td>2009/02/14</td>
<td>$452,500</td>
</tr>
<tr>
<td>Timothy Mooney</td>
<td>Office Manager</td>
<td>London</td>
<td>37</td>
<td>2008/12/11</td>
<td>$136,200</td>
</tr>
<tr>
<td>Jackson Bradshaw</td>
<td>Director</td>
<td>New York</td>
<td>65</td>
<td>2008/09/26</td>
<td>$645,750</td>
</tr>
<tr>
<td>Olivia Liang</td>
<td>Support Engineer</td>
<td>Singapore</td>
<td>64</td>
<td>2011/02/03</td>
<td>$234,500</td>
</tr>
<tr>
<td>Bruno Nash</td>
<td>Software Engineer</td>
<td>London</td>
<td>38</td>
<td>2011/05/03</td>
<td>$163,500</td>
</tr>
<tr>
<td>Sakura Yamamoto</td>
<td>Support Engineer</td>
<td>Tokyo</td>
<td>37</td>
<td>2009/08/19</td>
<td>$139,575</td>
</tr>
<tr>
<td>Thor Walton</td>
<td>Developer</td>
<td>New York</td>
<td>61</td>
<td>2013/08/11</td>
<td>$98,540</td>
</tr>
<tr>
<td>Finn Camacho</td>
<td>Support Engineer</td>
<td>San Francisco</td>
<td>47</td>
<td>2009/07/07</td>
<td>$87,500</td>
</tr>
<tr>
<td>Serge Baldwin</td>
<td>Data Coordinator</td>
<td>Singapore</td>
<td>64</td>
<td>2012/04/09</td>
<td>$138,575</td>
</tr>
<tr>
<td>Zenaida Frank</td>
<td>Software Engineer</td>
<td>New York</td>
<td>63</td>
<td>2010/01/04</td>
<td>$125,250</td>
</tr>
<tr>
<td>Zorita Serrano</td>
<td>Software Engineer</td>
<td>San Francisco</td>
<td>56</td>
<td>2012/06/01</td>
<td>$115,000</td>
</tr>
<tr>
<td>Jennifer Acosta</td>
<td>Junior Javascript Developer</td>
<td>Edinburgh</td>
<td>43</td>
<td>2013/02/01</td>
<td>$75,650</td>
</tr>
<tr>
<td>Cara Stevens</td>
<td>Sales Assistant</td>
<td>New York</td>
<td>46</td>
<td>2011/12/06</td>
<td>$145,600</td>
</tr>
<tr>
<td>Hermione Butler</td>
<td>Regional Director</td>
<td>London</td>
<td>47</td>
<td>2011/03/21</td>
<td>$356,250</td>
</tr>
<tr>
<td>Lael Greer</td>
<td>Systems Administrator</td>
<td>London</td>
<td>21</td>
<td>2009/02/27</td>
<td>$103,500</td>
</tr>
<tr>
<td>Jonas Alexander</td>
<td>Developer</td>
<td>San Francisco</td>
<td>30</td>
<td>2010/07/14</td>
<td>$86,500</td>
</tr>
<tr>
<td>Shad Decker</td>
<td>Regional Director</td>
<td>Edinburgh</td>
<td>51</td>
<td>2008/11/13</td>
<td>$183,000</td>
</tr>
<tr>
<td>Michael Bruce</td>
<td>Javascript Developer</td>
<td>Singapore</td>
<td>29</td>
<td>2011/06/27</td>
<td>$183,000</td>
</tr>
<tr>
<td>Donna Snider</td>
<td>Customer Support</td>
<td>New York</td>
<td>27</td>
<td>2011/01/25</td>
<td>$112,000</td>
</tr>
</tbody>
<tfoot>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
</div>
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
var table = $('#example').DataTable({
searchHighlight: true
});
} );</code>
</div>
</section>
</body>
</html>

@ -1,2 +1,2 @@
/*! © Nick Adkinson, SpryMedia Ltd - datatables.net/license */
!function(t){var n,e;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(i){return t(i,window,document)}):"object"==typeof exports?(n=require("jquery"),e=function(i,o){o.fn.dataTable||require("datatables.net")(i,o)},"undefined"==typeof window?module.exports=function(i,o){return i=i||window,o=o||n(i),e(i,o),t(o,0,i.document)}:(e(window,n),module.exports=t(n,window,window.document))):t(jQuery,window,document)}(function(d,i,s,o){"use strict";function a(i,o){var t=this,n=(i.on("draw",function(){t._updateFadedRows()}),i.table()),e=s.createElement("div");e.className="slider",this.s=d.extend({},{dt:i,table:d(n.node()),slider:d(e)},a.defaults,o),this._bind()}var t=d.fn.dataTable;a.prototype._bind=function(){var o=this,t=o.s;d(t.table,"> tbody").on("click",t.selector,function(){var i=d(this),i=i.is("tr")?i:i.closest("tr");i.is("tr")&&(i=t.dt.row(i),o._toggleChild(i))})},a.prototype._toggleChild=function(i){var o,t=this.s;i.child.isShown()?this._hideChild(i,function(){}):(o=t.dt.row(".shown")).length&&t.toggle?this._hideChild(o,this._showChildCallback(i)):this._showChild(i)},a.prototype._showChildCallback=function(i){return function(i){this._showChild(i)}.bind(this,i)},a.prototype._showChild=function(i){var o=d(i.node());this.s.displayLoadingIndicator&&this._addLoadingIndicator(o),this.s.source(o,this._response(i))},a.prototype._response=function(i){return function(i,o){this.__showChild(i,o)}.bind(this,i)},a.prototype.__showChild=function(i,o){var t=this.s,n=t.slider,e=d(i.node());t.displayLoadingIndicator&&d("."+this.s.loadingIndicatorClass).remove(),n.append(o),i.child(n,t.childClass).show(),e.toggleClass("shown"),this._updateFadedRows(),t.animateShow?this._showChildWithAnimation(i):this._showChildWithoutAnimation(i)},a.prototype._showChildWithAnimation=function(i){var o=this.s;d(o.slider,i.child()).slideDown(o.animationSpeed,function(){o.onShown(i)})},a.prototype._showChildWithoutAnimation=function(i){var o=this.s;d(o.slider,i.child()).show(),o.onShown(i)},a.prototype._hideChild=function(i,o){var t=this.s;d(i.node()).toggleClass("shown"),this._updateFadedRows(),t.animateHide?this._hideChildWithAnimation(i,o):this._hideChildWithoutAnimation(i,o)},a.prototype._hideChildWithAnimation=function(i,o){var t=this.s,n=t.slider;d(n,i.child()).slideUp(t.animationSpeed,function(){i.child.remove(),n.empty(),t.onHidden(i),o()})},a.prototype._hideChildWithoutAnimation=function(i,o){var t=this.s,n=t.slider;d(n,i.child()).hide(),i.child.remove(),n.empty(),t.onHidden(i),o()},a.prototype._updateFadedRows=function(){this.s.fadeNonShowingRows?(this._fadeNonShowingRows(),this._removeFadeFromShowingRows()):this._removeFadeFromRows()},a.prototype._fadeNonShowingRows=function(){this.s.dt.rows(".shown:visible").count()?this.s.dt.rows(":visible:not(.shown):not(.faded)").nodes().to$().css("opacity",this.s.fadeOpacity).addClass("faded"):this._removeFadeFromRows()},a.prototype._removeFadeFromShowingRows=function(){this.s.dt.rows(".shown.faded:visible").nodes().to$().css("opacity",1).removeClass("faded")},a.prototype._removeFadeFromRows=function(){this.s.dt.rows(".faded").nodes().to$().css("opacity",1).removeClass("faded")},a.prototype._addLoadingIndicator=function(i){var o=i.position(),t=d(this.s.loadingIndicatorContent);t.addClass(this.s.loadingIndicatorClass),t.css("top",o.top),t.css("left",o.left),t.css("height",i.height()),i.append(t)};return a.defaults={selector:"tr",childClass:"child",source:function(){},toggle:!0,animateShow:!0,animateHide:!0,fadeNonShowingRows:!1,fadeOpacity:.4,animationSpeed:200,onShown:function(){},onHidden:function(){},displayLoadingIndicator:!1,loadingIndicatorClass:"loading-indicator",loadingIndicatorContent:'<div style="background: black; color: white; display: flex; align-items: center; justify-content: center; opacity: 0.5; position: absolute; width: 100%; z-index: 100;">Loading...</div>'},t.SlidingChild=a,d(s).on("init.dt",function(i,o){"dt"===i.namespace&&(i=new t.Api(o),d(i.table().node()).hasClass("slidingChild")||o.oInit.slidingChild||t.defaults.slidingChild)&&new a(i,o.oInit.slidingChild)}),t});
!function(t){var n,e;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(i){return t(i,window,document)}):"object"==typeof exports?(n=require("jquery"),e=function(i,o){o.fn.dataTable||require("datatables.net")(i,o)},"undefined"==typeof window?module.exports=function(i,o){return i=i||window,o=o||n(i),e(i,o),t(o,0,i.document)}:(e(window,n),module.exports=t(n,window,window.document))):t(jQuery,window,document)}(function(d,i,s){"use strict";function a(i,o){var t=this,n=(i.on("draw",function(){t._updateFadedRows()}),i.table()),e=s.createElement("div");e.className="slider",this.s=d.extend({},{dt:i,table:d(n.node()),slider:d(e)},a.defaults,o),this._bind()}var t=d.fn.dataTable;a.prototype._bind=function(){var o=this,t=o.s;d(t.table,"> tbody").on("click",t.selector,function(){var i=d(this),i=i.is("tr")?i:i.closest("tr");i.is("tr")&&(i=t.dt.row(i),o._toggleChild(i))})},a.prototype._toggleChild=function(i){var o,t=this.s;i.child.isShown()?this._hideChild(i,function(){}):(o=t.dt.row(".shown")).length&&t.toggle?this._hideChild(o,this._showChildCallback(i)):this._showChild(i)},a.prototype._showChildCallback=function(i){return function(i){this._showChild(i)}.bind(this,i)},a.prototype._showChild=function(i){var o=d(i.node());this.s.displayLoadingIndicator&&this._addLoadingIndicator(o),this.s.source(o,this._response(i))},a.prototype._response=function(i){return function(i,o){this.__showChild(i,o)}.bind(this,i)},a.prototype.__showChild=function(i,o){var t=this.s,n=t.slider,e=d(i.node());t.displayLoadingIndicator&&d("."+this.s.loadingIndicatorClass).remove(),n.append(o),i.child(n,t.childClass).show(),e.toggleClass("shown"),this._updateFadedRows(),t.animateShow?this._showChildWithAnimation(i):this._showChildWithoutAnimation(i)},a.prototype._showChildWithAnimation=function(i){var o=this.s;d(o.slider,i.child()).slideDown(o.animationSpeed,function(){o.onShown(i)})},a.prototype._showChildWithoutAnimation=function(i){var o=this.s;d(o.slider,i.child()).show(),o.onShown(i)},a.prototype._hideChild=function(i,o){var t=this.s;d(i.node()).toggleClass("shown"),this._updateFadedRows(),t.animateHide?this._hideChildWithAnimation(i,o):this._hideChildWithoutAnimation(i,o)},a.prototype._hideChildWithAnimation=function(i,o){var t=this.s,n=t.slider;d(n,i.child()).slideUp(t.animationSpeed,function(){i.child.remove(),n.empty(),t.onHidden(i),o()})},a.prototype._hideChildWithoutAnimation=function(i,o){var t=this.s,n=t.slider;d(n,i.child()).hide(),i.child.remove(),n.empty(),t.onHidden(i),o()},a.prototype._updateFadedRows=function(){this.s.fadeNonShowingRows?(this._fadeNonShowingRows(),this._removeFadeFromShowingRows()):this._removeFadeFromRows()},a.prototype._fadeNonShowingRows=function(){this.s.dt.rows(".shown:visible").count()?this.s.dt.rows(":visible:not(.shown):not(.faded)").nodes().to$().css("opacity",this.s.fadeOpacity).addClass("faded"):this._removeFadeFromRows()},a.prototype._removeFadeFromShowingRows=function(){this.s.dt.rows(".shown.faded:visible").nodes().to$().css("opacity",1).removeClass("faded")},a.prototype._removeFadeFromRows=function(){this.s.dt.rows(".faded").nodes().to$().css("opacity",1).removeClass("faded")},a.prototype._addLoadingIndicator=function(i){var o=i.position(),t=d(this.s.loadingIndicatorContent);t.addClass(this.s.loadingIndicatorClass),t.css("top",o.top),t.css("left",o.left),t.css("height",i.height()),i.append(t)};return a.defaults={selector:"tr",childClass:"child",source:function(){},toggle:!0,animateShow:!0,animateHide:!0,fadeNonShowingRows:!1,fadeOpacity:.4,animationSpeed:200,onShown:function(){},onHidden:function(){},displayLoadingIndicator:!1,loadingIndicatorClass:"loading-indicator",loadingIndicatorContent:'<div style="background: black; color: white; display: flex; align-items: center; justify-content: center; opacity: 0.5; position: absolute; width: 100%; z-index: 100;">Loading...</div>'},t.SlidingChild=a,d(s).on("init.dt",function(i,o){"dt"===i.namespace&&(i=new t.Api(o),d(i.table().node()).hasClass("slidingChild")||o.oInit.slidingChild||t.defaults.slidingChild)&&new a(i,o.oInit.slidingChild)}),t});

@ -105,14 +105,14 @@ PLUGINS="${DT_SRC}/extensions/Plugins"
# ts_plugin $file
# done
# for file in $PLUGINS/features/*/src/*.ts; do
# ts_plugin $file
# done
for file in $PLUGINS/sorting/src/*.ts; do
for file in $PLUGINS/features/*/src/*.ts; do
ts_plugin $file
done
# for file in $PLUGINS/sorting/src/*.ts; do
# ts_plugin $file
# done
# for file in $PLUGINS/type-detection/src/*.ts; do
# ts_plugin $file
# done

Loading…
Cancel
Save