Saturday, 15 March 2014

jquery - Custom scrollbar for Bootstrap Table -



jquery - Custom scrollbar for Bootstrap Table -

i have striped table done using bootstrap table next code (from first illustration on http://wenzhixin.net.cn/p/bootstrap-table/docs/examples.html). need find way scrollbar 1 generated slimscroll (http://rocha.la/jquery-slimscroll). non-negotiable client requirement.

<table data-toggle="table" data-url="data1.json" data-cache="false" data-height="299"> <thead> <tr> <th data-field="id">item id</th> <th data-field="name">item name</th> <th data-field="price">item price</th> </tr> </thead> </table>

questions:

1) doable, , if - how?

2) if not doable bootstrap table, there library create scrollbar of type tbody? (slimscroll works on div, not tbody)

3) if neither (1) nor (2) possible, options fixed-header scrollable-body table implementation scrollbar of type?

edit:

i unable create fully-functional jsfiddle, since bootstrap-table doesn't appear load via external resources. was, however, able create jsfiddle showing tbody slimscroll applied does. stand-alone div scrolls fine. tbody of table next not.

this works out of box.

inspecting generated bootstrap table elements, it's not scrolling <tbody> wrapper div of '.fixed-table-body'.

just use:

$(document).ready(function () { $('.fixed-table-body').slimscroll({}); });

here's working example.

jquery css twitter-bootstrap slimscroll scrollable-table

No comments:

Post a Comment