Hello
I am trying to create an array instead of a string from a table.
Array syntax is like this:
var tabledata = [{Column1:}];
Normal string is like this:
var myArray = null;
The library I am using is expecting an array instead of a string:
I am trying to pass it data like this:
And receiving the error seen above.
Their example is a bit more static (I am basically trying to achieve this but using a Laserfiche Forms table that has looked up data inside):
My question is basically how do I build an array from this table:
Everything works so far, except for being able to create an array.
Code:
$(document).ready(function () {
$('.table').on('blur', 'input', appendArray);
var column1 = new Array();
function appendArray () {
$('.table tbody tr').each(function () {
column1 = $(this).find('.c1 input').val();
console.log(column1);
})
$('head').append('<link href="https://unpkg.com/tabulator-tables@4.5.3/dist/css/tabulator.min.css" rel="stylesheet">');
$.getScript('https://unpkg.com/tabulator-tables@4.5.3/dist/js/tabulator.min.js', function() {
var table = new Tabulator('.tablea', {
layout:"fitColumns",
columns:[
{title:"Column1", field:column1, editor:"input"},
],
});
})
}
});