Recommendation request: which example to base my table on
Recommendation request: which example to base my table on
Anonymole
Posts: 13Questions: 2Answers: 1
Tribe,
I've got to build a table that looks like this:
From Json that looks like this: JSON here
Can anyone recommend which example I should use to get started? Just a pointer really. Datatables is so full featured I just don't know where to start.
Thanks, AM
This question has accepted answers - jump to:
This discussion has been closed.
Answers
I would suggest reading through the data section of the manual to start with.
Also your "JSON" isn't really JSON - it is just a string (note the
"
that starts the string).Allan
Allan, Thanks. Will read that. It's JSON formatted, just that I copied it from the InteractiveUI printed out of VS (which adds quotes to strings).
All, I was successful in building the initial parent table.
And I've used the row click code to show/hide child content.
However this content is statically created using primitive, manual table, row cell construction which returns a dom snippet, which seems the wrong way to do this.
I'm sure there's a way to inject another datatable into the child area but I've been unsuccessful in find an example. The data for the child table is contained within the row.data() of row being clicked. And I can see to pass this data into a format function. And this would be OK if I could build a new dataTable and fetch the DOM html out of it to pass back as the injected HTML. (that seems broken too but it would suffice.)
JSON arrays within JSON arrays seems like a natural and common pattern to show. And showing datatables within datatables the obvious choice to handle this. And examples of this?
Or, let's say I just wanted to build a datatable and return the HTML...
How might I do this. This obviously doesn't work. But can I do
or
or ... any recommendations?
This is all part of that:
Got it. This works...
Good to hear :-)
Allan