Access an object inside another object.
Access an object inside another object.
Hello Allan, how do I access an object inside another object by placing that object accessed inside a select type list in form editor. The item I speak of is marked in bold, => "MinhasContas" => "Nome"
{
"draw": 0,
"recordsTotal": 8,
"recordsFiltered": 7,
"dataReceitas": null,
"data": [{
"id": 9,
"descricaoReceita": "Receita 9999",
"dataReceita": {
"year": 2017,
"month": "AUGUST",
"dayOfMonth": 8,
"dayOfWeek": "TUESDAY",
"era": "CE",
"dayOfYear": 220,
"leapYear": false,
"monthValue": 8,
"chronology": {
"id": "ISO",
"calendarType": "iso8601"
}
},
"valorReceita": 5000.00,
"receitaFixa": true,
"receitaFixaQuantidade": 1,
"receitaFixaTempo": "DIAS",
"repetirLancReceita": false,
"repetirPorPeriodo": "MENSAL",
"pagamento": false,
"addObservacao": "dgdg",
"**tipoReceitas**": [{
"id": 5,
"**nome**": "Tipo 5",
"corTipoReceita": "#AFFJKL",
"nomeTipoReceita": "Tipo 5"
}],
"**minhasContas**": [{
"id": 1,
"**nome**": "**Contas 1**",
"dataAcesso": {
"year": 2017,
"month": "JANUARY",
"dayOfMonth": 1,
"dayOfWeek": "SUNDAY",
"era": "CE",
"dayOfYear": 1,
"leapYear": false,
"monthValue": 1,
"chronology": {
"id": "ISO",
"calendarType": "iso8601"
}
},
"saldoAnterior": 0.00,
"saldoAtual": 5600.00,
"saldoFinal": 2520.00,
"tipo": "POUPANCA",
"cor": "#5d4aas",
"dashBoard": false
}],
"etiquetas": [{
"id": 156,
"nome": "fghfhfgh",
"minhasReceitas": null
}],
"cor": "rgb(255, 24, 01, 0.8)"
}, {
"id": 225,
"descricaoReceita": "gfgsd",
"dataReceita": {
"year": 2017,
"month": "AUGUST",
"dayOfMonth": 9,
"dayOfWeek": "WEDNESDAY",
"era": "CE",
"dayOfYear": 221,
"leapYear": false,
"monthValue": 8,
"chronology": {
"id": "ISO",
"calendarType": "iso8601"
}
},
"valorReceita": 5000.00,
"receitaFixa": true,
"receitaFixaQuantidade": null,
"receitaFixaTempo": null,
"repetirLancReceita": false,
"repetirPorPeriodo": null,
"pagamento": false,
"addObservacao": "werwe",
"tipoReceitas": [{
"id": 5,
"nome": "Tipo 5",
"corTipoReceita": "#AFFJKL",
"nomeTipoReceita": "Tipo 5"
}],
"**minhasContas**": [{
"id": 2,
"**nome**": "**Contas 2**",
"dataAcesso": {
"year": 2017,
"month": "FEBRUARY",
"dayOfMonth": 1,
"dayOfWeek": "WEDNESDAY",
"era": "CE",
"dayOfYear": 32,
"leapYear": false,
"monthValue": 2,
"chronology": {
"id": "ISO",
"calendarType": "iso8601"
}
},
"saldoAnterior": 0.00,
"saldoAtual": 2600.00,
"saldoFinal": 1500.00,
"tipo": "POUPANCA",
"cor": "#5d4aas",
"dashBoard": false
}],
"etiquetas": [{
"id": 157,
"nome": "xcswfswe",
"minhasReceitas": null
}],
"cor": null
}]
}
Answers
Use dotted notation, for example:
See Nested objects data example for demonstration and more information.
See more articles about jQuery DataTables on gyrocode.com.
The attribute access refers to the form editor where I can not access it, in the datatable I usually have access ..
I think this is a duplicate of this discussion. I've added a reply there.
Please don't post duplicates.
Allan