Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/dev-docs/feature-format-matrix/dist/js/jquery_wrapper.js
3562 views
1
/*
2
* This file is part of the Tabulator package.
3
*
4
* (c) Oliver Folkerd <[email protected]>
5
*
6
* For the full copyright and license information, please view the LICENSE
7
* file that was distributed with this source code.
8
*
9
* Full Documentation & Demos can be found at: http://olifolkerd.github.io/tabulator/
10
*
11
*/
12
13
(function (root, factory) {
14
"use strict";
15
if (typeof define === 'function' && define.amd) {
16
define(['jquery', 'tabulator', 'jquery-ui'], factory);
17
}
18
else if(typeof module !== 'undefined' && module.exports) {
19
module.exports = factory(
20
require('jquery'),
21
require('tabulator'),
22
require('jquery-ui')
23
);
24
}
25
else {
26
factory(root.jQuery, root.Tabulator);
27
}
28
}(this, function ($, Tabulator) {
29
30
$.widget("ui.tabulator", {
31
_create:function(){
32
var options = Object.assign({}, this.options);
33
var props = [];
34
35
delete options.create;
36
delete options.disabled;
37
38
this.table = new Tabulator(this.element[0], options);
39
window.table = this.table;
40
41
//retrieve properties on prototype
42
props = Object.getOwnPropertyNames(Object.getPrototypeOf(Object.getPrototypeOf(this.table)));
43
44
//retrieve properties added by modules
45
props = props.concat(Object.getOwnPropertyNames(this.table));
46
47
//map tabulator functions to jquery wrapper
48
for(let key of props){
49
if(typeof this.table[key] === "function" && key.charAt(0) !== "_"){
50
this[key] = this.table[key].bind(this.table);
51
}
52
}
53
},
54
55
_setOption: function(option, value){
56
console.error("Tabulator jQuery wrapper does not support setting options after the table has been instantiated");
57
},
58
59
_destroy: function(option, value){
60
this.table.destroy();
61
},
62
});
63
}));
64
65