jquery - datatables add class to filters -
i seeking method add additional custom class jquery datatables filters (records per page , search)
these items render follow:
<div id="datatables_table_0_length" class="datatables_length"> <label><select size="1" name="datatables_table_0_length" aria-controls="datatables_table_0"> <option value="10" selected="selected">10</option> <option value="25">25</option><option value="50">50</option> <option value="100">100</option> </select> records per page</label> </div> and
<div class="datatables_filter" id="datatables_table_0_filter"> <label>search: <input type="text" aria-controls="datatables_table_0"></label> </div> does know how can best add additional class each of them? advise usual appreciated.
check out http://legacy.datatables.net/styling/custom_classes. datatables has complicated way override css classes of core elements. here's 1 way
$(document).ready(function() { var extensions = { "sfilter": "datatables_filter custom_filter_class", "slength": "datatables_length custom_length_class" } // used when bjqueryui false $.extend($.fn.datatableext.ostdclasses, extensions); // used when bjqueryui true $.extend($.fn.datatableext.ojuiclasses, extensions); $('#example').datatable(); }); check out working example here: http://jsfiddle.net/k2ava/3/.
Comments
Post a Comment