I am trying to create a table that displays in each repeater box with only the data for that one item. With the code I have written, I am to get the itemData to display for the first item only in ALL of the boxes? For instance, instead of having a different title of a book in each repeater, it displays the same title in all repeaters. If use console.log, the correct title displays in the console but not on the page.
export function archiveResults_itemReady ( $item , itemData , index ) {
$item ( “#dynamicTable” ). columns = [ // id of table to display content in
{
“id” : “Title” ,
“dataPath” : “title” ,
“width” : 180 ,
“label” : “” ,
“type” : “string” ,
// Path for the column if it contains a link
“linkPath” : “link-field-or-property”
},
{
“id” : “Content” ,
“dataPath” : “content” ,
“width” : 300 ,
“label” : “” ,
“visible” : true ,
“type” : “string” ,
“linkPath” : “link-field-or-property”
}];
let itemTitle = itemData . title ;
console . log ( itemTitle );
const tableData = [
{ “title” : “Title” , “content” : itemTitle },
{ “title” : “Language:” , “content” : itemData.language },
{ “title” : “Date of Publication:” , “content” : itemData . date },
{ “title” : “Source:” , “content” : itemData . source },
{ “title” : “Holding Institution:” , “content” : itemData . institution },
{ “title” : “Publisher:” , “content” : itemData . publisher },
{ “title” : “Material Type:” , “content” : itemData . type }
];
$item ( “#dynamicTable” ). rows = tableData ;
}