-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c174a59
commit 1e62e76
Showing
110 changed files
with
86,388 additions
and
72 deletions.
There are no files selected for viewing
File renamed without changes.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2015-2020 Oli Folkerd | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
 | ||
|
||
An easy to use interactive table generation JavaScript library | ||
|
||
Full documentation & demos can be found at: [http://tabulator.info](http://tabulator.info) | ||
*** | ||
 | ||
*** | ||
|
||
Features | ||
================================ | ||
Tabulator allows you to create interactive tables in seconds from any HTML Table, Javascript Array or JSON formatted data. | ||
|
||
Simply include the library and the css in your project and you're away! | ||
|
||
Tabulator is packed with useful features including: | ||
|
||
 | ||
|
||
|
||
Frontend Framework Support | ||
================================ | ||
Tabulator is built to work with all the major front end JavaScript frameworks including React, Angular and Vue. | ||
|
||
|
||
Setup | ||
================================ | ||
Setting up tabulator could not be simpler. | ||
|
||
Include the library and the css | ||
```html | ||
<link href="dist/css/tabulator.min.css" rel="stylesheet"> | ||
<script type="text/javascript" src="dist/js/tabulator.min.js"></script> | ||
``` | ||
|
||
Create an element to hold the table | ||
```html | ||
<div id="example-table"></div> | ||
``` | ||
|
||
Turn the element into a tabulator with some simple javascript | ||
```js | ||
var table = new Tabulator("#example-table", {}); | ||
``` | ||
|
||
|
||
### Bower Installation | ||
To get Tabulator via the Bower package manager, open a terminal in your project directory and run the following commmand: | ||
``` | ||
bower install tabulator --save | ||
``` | ||
|
||
### NPM Installation | ||
To get Tabulator via the NPM package manager, open a terminal in your project directory and run the following commmand: | ||
``` | ||
npm install tabulator-tables --save | ||
``` | ||
|
||
### CDN - UNPKG | ||
To access Tabulator directly from the UNPKG CDN servers, include the following two lines at the start of your project, instead of the localy hosted versions: | ||
```html | ||
<link href="https://unpkg.com/tabulator-tables/dist/css/tabulator.min.css" rel="stylesheet"> | ||
<script type="text/javascript" src="https://unpkg.com/tabulator-tables/dist/js/tabulator.min.js"></script> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
let ArrayData = []; | ||
let ArrayColumn = []; | ||
let table; | ||
let selectedRow = null; | ||
// Initialize the custom control (without a successful initialization, the CWC will remain empty. Make sure to include the webcc.min.js script!) | ||
// "result" is a boolean defining if the connection was successfull or not. | ||
function init(result) { | ||
if (result) { | ||
webccInterfaceInit(); | ||
} else { | ||
console.log('Connection NOK'); | ||
} | ||
} | ||
WebCC.start(init, webccInterface.contract, EXTENSIONS, TIMEOUT); | ||
function showDemoData() { | ||
// Get the table container element | ||
var tableContainer = document.getElementById("example-table"); | ||
} | ||
function drawTable(columnStyleString, tableDataString) { | ||
try { | ||
var tabledata = (tableDataString && JSON.parse(tableDataString)) || []; | ||
var columnStyle = (columnStyleString && JSON.parse(columnStyleString)) || []; | ||
} catch(e) { | ||
console.error('Error parsing JSON:', e); | ||
return; | ||
} | ||
//choose how the table should look like or behave. More information on http://tabulator.info/ | ||
table = new Tabulator("#example-table", { | ||
height: 'calc(100% - 2px)', // set height of table to 100% minus 2 px, because the border of the table is 1px top and border | ||
data: tabledata, //load initial data into table | ||
layout: "fitColumns", //fit columns to width of table (optional) | ||
columns: columnStyle, | ||
selectable: true, // Enable selection | ||
rowClick: function (e, row) { // Table configuration options | ||
// Deselect all rows | ||
if (selectedRow) { | ||
table.deselectRow(); | ||
} | ||
// Select the clicked row | ||
row.select(); | ||
selectedRow = row; | ||
} | ||
}); | ||
} | ||
function showRuntimeData() { | ||
// Get the table container element | ||
var tableContainer = document.getElementById("example-table"); | ||
// Attach a click event listener to the table container | ||
tableContainer.addEventListener("click", function () { | ||
// Get the selected row(s) | ||
var selectedRows = table.getSelectedRows(); | ||
WebCC.Events.fire("SelectedRow",selectedRows[0]._row.data); | ||
}); | ||
} |
Oops, something went wrong.