Separate the contents of an Array into a Table

1
0
-1

I created an array in UI Designer via Javascript, but when I display my Array in a table, the content of the array is one line below the other, how can I break the contents of the sse array and separate it into columns?

I created the array this way:

for (var z = 0; z <= $data.formInput.pedido.itensPedido.length - 1; z++){
if ($data.formInput.pedido.itensPedido[z].impressoraPedido.codigoImpressora == $data.formInput.pedido.itensPedido[z].suprimentoPedido.codigoModeloImpressora){
obj.push($data.formInput.pedido.itensPedido[z].impressoraPedido.codigoImpressora);
obj.push($data.formInput.pedido.itensPedido[z].impressoraPedido.modeloImpressora);
obj.push($data.formInput.pedido.itensPedido[z].suprimentoPedido.nomeSuprimento);
obj.push($data.formInput.pedido.itensPedido[z].quantidadePedido);
}
}

return obj;
https://drive.google.com/file/d/0B8aMiLwwVY0nWjBIRXpYaWdxajQ/view?usp=sh...

1 answer

1
0
-1

Hi,

In your case, you need to select the column you want to display. So the JSON that populate the table should be a list of objects.

By example, let's say you construct your JSON to look like this:

[{"firstName": "John", "lastName": "Doe", "birthDate": "1999-01-01"}, {"firstName": "Rachel", "lastName": "Bryant", "birthDate": "1999-04-01"}]

In that case, in the Columns field of the table, you will enter: firstName, lastName, birthDate to display this data.

Cheers

Notifications