Display Nested Array Data with concatination
Display Nested Array Data with concatination
My Json looks like
data{
campaignname:first
products{
title:aa
slug:bb
pivot{price:20}
}{
title:aa1
slug:bb1
pivot{price:21}
}{
title:aa2
slug:bb2
pivot{price:22}
}
}{
campaignname:firsecond
products{
title:aa
slug:bb
pivot{price:20}
}
title:aa2
slug:bb2
pivot{price:22}
}
}
After going through all forums i have managed to display the content in 2 rows with products sepaarted by comma in 1 column example
first aa,aa1,aa2
second aa,aa2
for displaying products i am using {data: "products", "render": {
"_": "[].title"
}}
my Requirement is
first aa-20,aa1-21,aa2-22
second aa-20,aa2-22
I want to display price along with title , seek your help and advice on this.
Thanks
This question has an accepted answers - jump to answer
Answers
You'd need to define
columns.render
as a function and construct the output using a custom loop (I think - its hard to read your post!).Allan