No matching records found

No matching records found

sifuhallsifuhall Posts: 20Questions: 0Answers: 0
edited October 2009 in General
I'm pulling my hair out on this one. I've used datatables in the past and think it is great, but I can't seem to get this one working.

Here is my initialization code:

[code]
$().ready(function() {
$('#equipmentstore').dataTable( {
"bProcessing": true,
"sAjaxSource": '/ajax.php?action=get_equipment'
} )
});
[/code]

here is the html:
[code]



+
Brand
Item
Type
LVL
Quality
Bonuses
Price







+
Brand
Item
Type
LVL
Quality
Bonuses
Price



[/code]

and here is what the ajax call is returning:
[code]
{ "aaData": [
['link', '+'],
['Brand', 'my brand'],
['Item', 'Rigby Cat'],
['Type', 'cup'],
['Lvl', 'my level'],
['Quality', ''],
['Bonus', 'my bonus'],
['Price', '100.00']
]
}
[/code]

I'm sure the problem is something I'm doing but I just can't seem to find it.

Any help is greatly appreciated.

Replies

  • sifuhallsifuhall Posts: 20Questions: 0Answers: 0
    My issue was in the ajax returned.

    I'm not exactly sure where it was but I re-wrote that section and it is now working.
  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    Hi sifuhall,

    The issue (I suspect) is that your aaData arrays only have two elements in them for each row, but DataTables is expecting 8 (you've got 8 TH elements). Either way, if it's fixed now, we'll go with that :-)

    Regards,
    Allan
This discussion has been closed.