Control over row rendering\painting
Control over row rendering\painting
Hia,
I'm kinda new to DataTables, and would like to know if the following is possible (would appreciate any leads) :
I wish to have a table where I have complete control over how each row is rendered - unlike the grid structure that regular tables have (where each data item always appears in a grid cell), I want to manually construct the visual contents of each row (say, have my own little table covering the entirety of each row, and place the data items of that row in that little table in some arbitrary way).
Is that possbile with DataTables?
What would be a good way to go about it?
Thanks!
I'm kinda new to DataTables, and would like to know if the following is possible (would appreciate any leads) :
I wish to have a table where I have complete control over how each row is rendered - unlike the grid structure that regular tables have (where each data item always appears in a grid cell), I want to manually construct the visual contents of each row (say, have my own little table covering the entirety of each row, and place the data items of that row in that little table in some arbitrary way).
Is that possbile with DataTables?
What would be a good way to go about it?
Thanks!
This discussion has been closed.
Replies
Allan
Have a table with sorting+filtering+pagination, but: within every row, instead of showing
[code]
+--------+--------+--------+
| X | Y | Z |
+--------+--------+--------+
[/code]
I wish to show
[code]
+--------------------------+
| bla bla X bla Y bla Z |
+--------------------------+
[/code]
(i.e. some html div that will show the row's data the way I want it to show it)
...
Does your answer still apply?
Thanks
Jack
I had been thinking that it might be something like this:
[code]
+--------+--------+--------+
| A | B | C |
+--------+--------+--------+
| D | E | F |
+--------+--------+--------+
[/code]
and become something like this after filtering (i.e. moving cells around):
[code]
+--------+--------+
| A | C |
+--------+--------+
[/code]
However, what you want is more achievable, if I understand correctly. So you wish to combine the information in the columns into a single column table? What you could do is have an empty column and then hide all the other columns with the information in them - then use fnRowCallback to put the data you need into the visible column. It wouldn't allow sorting though of course, since you can see the data columns to sort on them (unless you provide hooks to do it which is also possible).
Allan