Q:

JQuery DataTables Object Keys as Rows

I'm using JQuery DataTables, and have an object like:
{
  table_rows: {
     row1: {val: value1},
     row2: {val: value2},
     ...
     rown: {val: valuen}
  }
}

I need to tell DataTables to use the object keys of the table_rows object as rows, but it will not.  Every example I can find has table_rows as an array of objects, which would be have table_rows [ {val: val1}, {val: val2} ...]
Any ideas how to make the former work?
EDIT: Added example:

http://jsfiddle.net/mbaranski/gh95yhqe/

Here is an example.

A:

You can write your own function to convert one format to another, for example:
function formatData(data){
   var result = [];
   for(prop in data['indices']){
      if(data['indices'].hasOwnProperty(prop)){
         result.push({ 'indices': prop });
      }
   }
   return result;
}

See updated jsFiddle for code and demonstration.
If you're using Ajax sourced data, see this jsFiddle for an idea on how to use the function above.

