I'm having this situation where I need to call a method from the dom-repeat. Below is my code.
I have two arrays one is _dataArray = [{
'abcd': 1234
}, {
'efgh': 5678
}]
and _objectArray = ['abcd', 'efgh']
Below is my code
<template is='dom-repeat' items="[[_dataArray]]" as="rowItem">
<template is='dom-repeat' items="[[_objectArray]]" as="columnItem">
<span>[[_getColumnItemValue(rowItem, columnItem)]]</span>
</template>
</template>and in my _getColumnItemValue method, I want to get the value for an object with key specified by the columnData attribute.
Like rowData[columnData]
_getColumnItemValue: function(rowData, columnData) {
return rowData[columnData];
}My problem is the method _getColumnItemValue is not being called. Is there any better way to do achieve this?
My problem is the method
_getColumnItemValueis not being called. Is there any better way to do achieve this?