diff options
author | Andrea Lepori <aleporia@gmail.com> | 2023-02-23 13:04:50 +0100 |
---|---|---|
committer | Andrea Lepori <aleporia@gmail.com> | 2023-02-23 13:05:10 +0100 |
commit | e489173e7ccbe7593e263b705c7937ff5be62b10 (patch) | |
tree | 929c2d90eb06cd652b9236006c97cb31a4e6922f /static/tabulator/js/jquery_wrapper.js | |
parent | fix missing variable for medic export (diff) | |
download | scout-subs-e489173e7ccbe7593e263b705c7937ff5be62b10.tar.gz scout-subs-e489173e7ccbe7593e263b705c7937ff5be62b10.zip |
add prototype for table of users
Diffstat (limited to 'static/tabulator/js/jquery_wrapper.js')
-rw-r--r-- | static/tabulator/js/jquery_wrapper.js | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/static/tabulator/js/jquery_wrapper.js b/static/tabulator/js/jquery_wrapper.js new file mode 100644 index 0000000..e8ff80f --- /dev/null +++ b/static/tabulator/js/jquery_wrapper.js @@ -0,0 +1,55 @@ +/* + * This file is part of the Tabulator package. + * + * (c) Oliver Folkerd <oliver.folkerd@gmail.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Full Documentation & Demos can be found at: http://olifolkerd.github.io/tabulator/ + * + */ + +(function (root, factory) { + "use strict"; + if (typeof define === 'function' && define.amd) { + define(['jquery', 'tabulator', 'jquery-ui'], factory); + } + else if(typeof module !== 'undefined' && module.exports) { + module.exports = factory( + require('jquery'), + require('tabulator'), + require('jquery-ui') + ); + } + else { + factory(root.jQuery, root.Tabulator); + } +}(this, function ($, Tabulator) { + + $.widget("ui.tabulator", { + _create:function(){ + var options = Object.assign({}, this.options); + + delete options.create; + delete options.disabled; + + this.table = new Tabulator(this.element[0], options); + + //map tabulator functions to jquery wrapper + for(var key in Tabulator.prototype){ + if(typeof Tabulator.prototype[key] === "function" && key.charAt(0) !== "_"){ + this[key] = this.table[key].bind(this.table); + } + } + }, + + _setOption: function(option, value){ + console.error("Tabulator jQuery wrapper does not support setting options after the table has been instantiated"); + }, + + _destroy: function(option, value){ + this.table.destroy(); + }, + }); +})); |