complex json

complex json

ledled Posts: 14Questions: 6Answers: 0

{"23gjsd91su3guu509o1bchhqms@group.calendar.google.com":{"calendar_id":"23gjsd91su3guu509o1bchhqms@group.calendar.google.com","calendar_title":"#1612 White Quartz Apartment"},"vqbidsn2u4edlvto0frvevk6ig@group.calendar.google.com":{"calendar_id":"vqbidsn2u4edlvto0frvevk6ig@group.calendar.google.com","calendar_title":"#994 Cisco Amber (T2)"},"bi07i6futd90lvq9ba8ufvqdu8@group.calendar.google.com":{"calendar_id":"bi07i6futd90lvq9ba8ufvqdu8@group.calendar.google.com","calendar_title":"#1443. Marley Blue"}}

problem is that the name of the object is dynamic.

thanks

Answers

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75
    edited October 2015

    Should use the formatting when posting data or code, and atleast a half way decent description. Im assuming this is the data for the table.. is it ajax source or just loval json? If its local json, just process it into the proper format yourself, then hand it to DT

  • allanallan Posts: 63,512Questions: 1Answers: 10,472 Site admin

    DataTables expects an array of information for the table rows - it will not accept an object. You would need to convert your object to an array.

    Allan

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75
    edited October 2015

    You could do it in a closure as the value to data or ajax though, i believe

  • ledled Posts: 14Questions: 6Answers: 0
  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    There ya go, id throw that function in the data value tho, as a closure, easier to maintain, imo

This discussion has been closed.