Page 1 of 1

Mapping Array to Grid Component(Columns)

Posted: Thu Jan 07, 2016 9:11 am
by taucher

Hello,

I want to map an array to grid component with four columns.

(Every column should span the data than a new row should created from the data.)

Thanks,


Mapping Array to Grid Component(Columns)

Posted: Thu Jan 07, 2016 1:00 pm
by John de Quarius

Toucher,

Where is the array data coming from? To map array values to the grid you need to define or add elements to the grid as the grid is simply just a table with empty fields meaning you need to add placeholder or element such as label or input. and if the array is coming from a service the you can simply do mapping.


Mapping Array to Grid Component(Columns)

Posted: Thu Jan 07, 2016 1:23 pm
by taucher

Hi John,

I can map the data as you wrote. There is no problem with mapping.

What i want :

For example: I have an array of images with urls, I need to display them in my grid with four columns. I want to display first four of them side by side in columns, then the grid should span new row for the next four images.

I hope, i could explain.


Mapping Array to Grid Component(Columns)

Posted: Thu Jan 07, 2016 1:45 pm
by John de Quarius

Could you post screenshots of the response and the grid please


Mapping Array to Grid Component(Columns)

Posted: Thu Jan 07, 2016 2:48 pm
by taucher

As you can see, the response is array. I want to display them in grid column cells side by side.

Image

The Response:

Image


Mapping Array to Grid Component(Columns)

Posted: Thu Jan 07, 2016 3:08 pm
by John de Quarius

Try doing this...
add a div element inside the list item and apply a css rule to the dive and the image element.

or you could set the image element to inline inside your list.


Mapping Array to Grid Component(Columns)

Posted: Sat Jan 09, 2016 8:55 am
by taucher

Thanks John, but couldn't make it work.