Looping through array for Tabulator

时间:2019-04-23 15:09:01

标签: tabulator

I have an array that I am attempting to push into a table using tabulator...

My dataTable line reads as followed..

var tableData = [<?php $array = print json_readable_encode ( pulseProxyStatus ( $uri, $authtoken ));?>];

This presents me with an empty table. However, If I specify a specific record from the json array, it will show me that one record, but I cannot see the entire result.

var tableData = [<?php $array = print json_readable_encode ( pulseProxyStatus ( $uri, $authtoken )[8]);?>];

How can I get this table to show the entire result of the JSON array. Do I need to loop through somehow?

1 个答案:

答案 0 :(得分:0)

一旦所有可用数据都遍历了,并如下图所示创建了一个数组,并使用table.setData(tableData)进行设置,如documentation

enter image description here