Using datatables to display random (nested) js objects
Using datatables to display random (nested) js objects
Hello.
This probably falls out of the scope of datatables, but no harm done asking.
I want to develop a CRUD app without reinventing the wheel. Using one of the many nosql databases I can just store the entire document without any object to relational nightmares. All I need is to solve the UI part.
Is datatables able to process a nested object? Maybe some combination of http://datatables.net/release-datatables/examples/server_side/row_details.html and http://jquery-datatables-editable.googlecode.com/svn/trunk/index.html ...
(if anyone has alternatives to this, feel free to suggest. I can't believe something like this doesn't exist yet)
This probably falls out of the scope of datatables, but no harm done asking.
I want to develop a CRUD app without reinventing the wheel. Using one of the many nosql databases I can just store the entire document without any object to relational nightmares. All I need is to solve the UI part.
Is datatables able to process a nested object? Maybe some combination of http://datatables.net/release-datatables/examples/server_side/row_details.html and http://jquery-datatables-editable.googlecode.com/svn/trunk/index.html ...
(if anyone has alternatives to this, feel free to suggest. I can't believe something like this doesn't exist yet)
This discussion has been closed.
Replies
Yes absolutely :-). DataTables can use any JSON data source as a data source through the mDataProp parameter ( http://datatables.net/ref#mDataProp ).
There is a blog post about it here: http://datatables.net/blog/Extended_data_source_options_with_DataTables .
There is also an example here of this in action: http://datatables.net/release-datatables/examples/ajax/deep.html (data source: http://datatables.net/release-datatables/examples/ajax/sources/deep.txt ). DataTables can use any level of Javascript object nesting you want (although obviously it gets slower the deeper the data since it needs to traverse the object structure).
Allan