I would like to add a bootstrap class of 'search-query' to the search input using sDom. Is this possible. The resulting markup would look something like...
Any ideas? I solved this by calling jQuery's addClass() after the datatable is rendered. This is less than ideal. Curious if there is a 'better' solution. Thanks in advance.
Why less than ideal? There is no option built into DataTables to add a class to that element - standard jQuery manipulation of the DOM is how I'd do it.
DataTables 1.11 will introduce the concept of renderers, where you will be able to define the HTML for the controls exactly, but they you need to define the whole lot, not just a single class.
"less than ideal" because it seems like sDom is where the whole configuration exists for any custom control markup. nice to look in one place. You *could* use standard jQuery manipulation to add the markup that sDom allows us to add, but we don't ;)
Looking forward to 1.11. You guys do an awesome job. Thanks.
Replies
DataTables 1.11 will introduce the concept of renderers, where you will be able to define the HTML for the controls exactly, but they you need to define the whole lot, not just a single class.
Allan
"less than ideal" because it seems like sDom is where the whole configuration exists for any custom control markup. nice to look in one place. You *could* use standard jQuery manipulation to add the markup that sDom allows us to add, but we don't ;)
Looking forward to 1.11. You guys do an awesome job. Thanks.