otsdaq_utilities  v2_05_02_indev
jquery_wrapper.js
1 /* Tabulator v4.5.3 (c) Oliver Folkerd */
2 
3 /*
4  * This file is part of the Tabulator package.
5  *
6  * (c) Oliver Folkerd <oliver.folkerd@gmail.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  *
11  * Full Documentation & Demos can be found at: http://olifolkerd.github.io/tabulator/
12  *
13  */
14 
15 (function (factory) {
16  "use strict";
17 
18  if (typeof define === 'function' && define.amd) {
19  define(['jquery', 'tabulator', 'jquery-ui'], factory);
20  } else if (typeof module !== 'undefined' && module.exports) {
21  module.exports = factory(require('jquery'), require('tabulator'), require('jquery-ui'));
22  } else {
23  factory(jQuery, Tabulator);
24  }
25 })(function ($, Tabulator) {
26 
27  $.widget("ui.tabulator", {
28  _create: function _create() {
29  var options = Object.assign({}, this.options);
30 
31  delete options.create;
32  delete options.disabled;
33 
34  this.table = new Tabulator(this.element[0], options);
35 
36  //map tabulator functions to jquery wrapper
37  for (var key in Tabulator.prototype) {
38  if (typeof Tabulator.prototype[key] === "function" && key.charAt(0) !== "_") {
39  this[key] = this.table[key].bind(this.table);
40  }
41  }
42  },
43 
44  _setOption: function _setOption(option, value) {
45  console.error("Tabulator jQuery wrapper does not support setting options after the table has been instantiated");
46  },
47 
48  _destroy: function _destroy(option, value) {
49  this.table.destroy();
50  }
51  });
52 });