I have two objects and I need to add properties to one object based on match from properties of another:
var dependsOn= {
qTableIdent: {
//External object key mapping( object key : external key)
'RHID': 'RHID',
'CD_AGREGADO': 'NOME'
}
},
var tableCols= [
{
"targets": 1,
"title": 'RHID',
"label": 'RHID',
"data": 'RHID',
"name": 'RHID',
"width": "5%",
"filter": true,
"defaultContent": "",
"visible":false,
"type": 'hidden', //ADD this to properties
attr: {
'name': 'rhid'
},
},.....
]
I would like to add:
"visible":false,
"type": 'hidden',
to tableCols
object where data
property matches the property in dependsOn
.
https://jsfiddle.net/zwpu70no/3/