table height depending on 'entries shown' parameter
table height depending on 'entries shown' parameter
Hi,
I'd like to make my datatable height depend on the "entries shown" parameter, even when filtering or reaching the end of pagination.
I read a few forum discussions already and it seems there is a way to do this by adding a div using 'sDom'.
eg: http://datatables.net/forums/discussion/2621/table-height-when-filtered-or-for-last-page/p1
So if I get this right, I'll have to update that div every time the amount of entries shown gets changed?
I thinks this is doable but looks like a moderately complicated solution. At the moment, I let the plugin take care of the height of the rows, so I would need to somehow grab that height, then multiply by the amount of entries shown and apply it to the div on some 'onEntriesShownChange' event. Once this is done, I guess I should prey the css/js gods that this solution works cross-browser.
I'm not complaining, I'm willing to do this if it's the only way. The plugin is great and will probably save me a lot of time but I was wondering... Is there a simpler way? If not, this could make a very good feature for a future release. Something like a "aFixedDisplayLength" boolean or similar.
All comments, advices, suggestions of any sort are welcome.
I'd like to make my datatable height depend on the "entries shown" parameter, even when filtering or reaching the end of pagination.
I read a few forum discussions already and it seems there is a way to do this by adding a div using 'sDom'.
eg: http://datatables.net/forums/discussion/2621/table-height-when-filtered-or-for-last-page/p1
So if I get this right, I'll have to update that div every time the amount of entries shown gets changed?
I thinks this is doable but looks like a moderately complicated solution. At the moment, I let the plugin take care of the height of the rows, so I would need to somehow grab that height, then multiply by the amount of entries shown and apply it to the div on some 'onEntriesShownChange' event. Once this is done, I guess I should prey the css/js gods that this solution works cross-browser.
I'm not complaining, I'm willing to do this if it's the only way. The plugin is great and will probably save me a lot of time but I was wondering... Is there a simpler way? If not, this could make a very good feature for a future release. Something like a "aFixedDisplayLength" boolean or similar.
All comments, advices, suggestions of any sort are welcome.
This discussion has been closed.
Replies
I'm sure there would be interest from others if you were to create such software :-). Its not something I think I would add to DataTables core, simply because I'm being very strict about features in the core that could be provided with plug-ins, in order to keep the file size as small as possible.
Allan
Michael