Subheaders support/incorporation into datatables
Subheaders support/incorporation into datatables
I might be doing it the wrong way in which case happy to be set straight, but there could really do with being better subheader support to allow for subheader filters to work better/easier
See the example:
http://live.datatables.net/momuhipi/1/
Ideally it should know it's header... and it would also be nice if you could access it with .subheader() or .header()[1] or some other means of getting a columns headers rather just the primary header.
This question has an accepted answers - jump to answer
Answers
subheader()
is not a bad idea, although we might end up withsubsubsubsubheader()
and it would get messier with complex headers!What I would typically recommend is you use
table().header()
to get thethead
element and the just use regular jQuery to parse through the rows / cells as you require.Allan
Yeah, I thought of that... but had an issue with Datatables vs Dom idea of index, which was made even more complex with colspan's which is why I came to the conclusion that storing it in datatables would probably be the nicest way as it'd allow for a lot more functionality, but yes... you would potential have to return an array of subheaders or have them say subheader(n).
It's also about being able to do column(subheader) to get a handle on the column
More generally this is something that I know I need to address for the interface with Buttons as well, where it would be nice to have multiple header and footer row support.
This is most certainly something that I need to address with a new API, I'm just not sure what form it should take yet (haven't had a chance to think much about its design yet!).
Allan
Ok, thanks, I'll try and do a mock up this evening of how I've been using it, might help you see my use case which I'd like to think is a good way of doing things, and can show how I've attempted to address the missing support (probably badly).
Will probably be tomorrow that I add a use case