Issue with array field

Issue with array field

ukmanukman Posts: 1Questions: 0Answers: 0
edited September 2013 in Bug reports
Hello,
I have a problem with the following example. Here two column that displays data from array.
It works fine when marked line is commented, but when it's uncommented, all data from columns "Car Models" and "Car Years" disappear.

[code]







var data = [
{
id : 1,
name : "Jack",
cars : [
{
name : "Mercedez",
year : 1960
},
{
name : "Ferrari",
year : 1965
}
]
},
];
$(document).ready(function(){

$('#example').dataTable( {
aaData : data,
aoColumns: [
{ "mData": "id", "sTitle": "ID"},
{ "mData": "name", "sTitle": "Name"},
{ "mData": "cars[].name", "sTitle": "Car Models"},

//////////////////////////////////////////////////////// PROBLEM IS HERE
{ "mData": "cars[].year", "sTitle": "Car Years"}, // COMMENT/UCOMMENT THIS LINE
////////////////////////////////////////////////////////
],

});
});






[/code]

Ready example is here

http://jsfiddle.net/Ah26y/

Replies

  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin
    Thanks for the test case. I don't know why that isn't working I'm afraid. I'll need to look into it a bit more. Bookmarked to ensure that I do look it when I have a moment to do so.

    Allan
This discussion has been closed.