Just like @Tobymosque said, so if you want to iterate dates sequentially, you can do so:
var dates = {};
for (var key in val) {
var index = key.indexOf("/"),
year = key.substr(index + 1);
/* checa se o ano já não foi definido e
checa se key aparenta ser uma data */
if (!dates[year] && index !== -1)
dates[year] = {};
}
for (key in val) {
var index = key.indexOf("/");
/* checa se key aparenta ser uma data */
if (index !== -1)
dates[key.substr(index + 1)][key.substr(0, index)] = val[key];
}
Now you can iterate the array normally dates
and concatenate the data of the months:
var html = "";
for (var year of dates) {
for (var month of year) {
html += '<td align="right">' + month + '</td>';
}
}
$('#resultAluno tbody').append('<tr><td>' +
val.CURSO + '</td> <td>' +
val.SITUACAO + '</td><td align="right">' +
val.TOTAL_FINANCIAMENTO + '</td><td align="right">' +
val.SEMESTRES_FINANCIADOS + '</td><td align="right">' +
val.DATA_REPASSE + '</td>' + html + "</tr>"
);
From what I understand by "
val['01/2010']
" then'01/2010'
is the key and not the value– Miguel
@Miguel is just like that
– Leandro
want the key so, how is your loop? By the code that showed what to use there is the key
– Miguel
Format your Json, with something like
[
 {"Data":"01/2010"},
 {"Data":"02/2010"},
 {"Data":"03/2010"}
]
– Marconi