Hello everyone I have problem with reactive table field monthlyFee array.
When I use loop array monthlyFee field and then return object in loop why it do not return this field show on template
Please
Here my data
let data = {
gender: "Male"
monthlyFee: [
{period: "01-08", due: 45}, {period: "01-09", due: 45}, {period: "01-10", due: 45},
{period: "01-11", due: 45}, {period: "01-12", due: 45}, {period: "01-01", due: 45}
{period: "01-02", due: 45}, {period: "01-03", due: 45}, {period: "01-04", due: 45}
{period: "01-05", due: 45}, {period: "01-06", due: 45}, {period: "01-07", due: 45}
]
name: "ដាញ់ សុផាន់"
phone: "092 953 065"
sectionDetailId: "001-00003570"
startDate: Wed Aug 01 2018 09:57:03 GMT+0700 (Indochina Time)
}
Here is my code reactive table
let reactiveTableData = (instance) => {
let fields = [
{ key: 'sectionDetailId', label: 'ID' },
{ key: 'name', label: 'KhName' },
{ key: 'gender', label: 'Gender' },
{ key: 'phone', label: 'Phone' },
{
key: 'startDate',
label: 'Date',
fn: function(value, object, key) {
return moment(value).format('DD/MM/YYYY');;
}
},
{
key: 'monthlyFee',
label: 'Monthly Fee',
fn(value, obj, index) {
value.forEach((o, index) => {
return o.due
});
}
}
return _.assignIn(_.clone(reactiveTableSettings), {
showFilter: true,
showNavigation: 'auto',
showColumnToggles: false,
collection: LocalCollection,
rowsPerPage: 10,
showRowCount: true,
fields
});
};