I'm testing a plugin to load a Json into a table, the footable, I was able to make it load the simple Json. But when I test a Json in which one of the columns is a Json object I can not see the fields of that object.
Json below:
[
{
"pessoa": {
"id": 1,
"tipo": "J",
"razao_social": "INTELIDER",
"nome_fantasia": "INTELIDER LTDA",
"cpf_cnpj": "10999558000186",
"rg_insc_estadual": "132456789"
},
"id": 1,
"login": "gleyson",
"senha": "123456",
"ativo": "S"
},
{
"pessoa": {
"id": 11,
"tipo": "F",
"razao_social": "i9maker ltda",
"nome_fantasia": "INTELIDER LTDA",
"cpf_cnpj": "",
"rg_insc_estadual": "123456"
},
"id": 11,
"login": "gleyson",
"senha": "123456",
"ativo": "S"
}
]
The load code is this:
$('.table').footable({
"columns": [
{ "name": "login", "title": "Login"},
{ "name": "razao_social", "title": "Razão Social", "breakpoints": "xs" },
{ "name": "nome_fantasia", "title": "Nome fantasia", "breakpoints": "xs" },
{ "name": "cpf_cnpj", "title": "CNPJ", "breakpoints": "xs sm" },
{ "name": "rg_insc_estadual", "title": "Inscrição", "breakpoints": "xs sm md" }
],
"rows": result
});
I pass the Json to the function through the variable result.
The table is loaded but the fields that refer to the person class do not appear: