3

for my web project I'm going to use the "Bootstrap-Table" extension. I've some integer values in my table, for example the age of a person and I want to filter the age with greater/smaller than a number. In the current BS table issues there is only an example for filtering an integer value equal to a number.

Is there a possibility for this filter option?

Best regards

SKiD
  • 441
  • 1
  • 3
  • 16
  • Possible duplicate of [Bootstrap - How to sort table columns](http://stackoverflow.com/questions/31888566/bootstrap-how-to-sort-table-columns) – Yash Gupta Mar 30 '17 at 15:31

2 Answers2

0

Here is a W3Schools example for generalized filtering

www.w3schools.com/howto/howto_js_filter_table.asp

Here is a Pen for bootstrap with both search and dropdown filtering

codepen.io/AurelieT/pen/JGxMgo

Check out the JS Settings to find the code for filtering

Here is a official Bootstrap extension that does what you want.:

github.com/wenzhixin/bootstrap-table/tree/master/src/extensions/filter-control

Here is a fiddle:

jsfiddle.net/giorgitbs/52ak9/1/

Yash Gupta
  • 73
  • 8
  • Thank you for your answer, but it seems like my question wasn't clear enough. I know that it is possible JS and other options, but I use the build-in function of "filterBy" of the bootstrap-table. I was thinking that there must be already a greater oder smaller possibility? Or do I have really to build a work around with JS etc? – SKiD Mar 30 '17 at 11:19
  • Ah, so your looking for sorting, not filtering. Your in luck, stack overflow has that question asked and answered! http://stackoverflow.com/questions/31888566/bootstrap-how-to-sort-table-columns – Yash Gupta Mar 30 '17 at 15:31
0

If you are using the Bootstrap Table plugin (sources here), you need to use its Filter Control Extension (sources here)

But, going through the documentation and sample page, it seems that filtering by an integer column comparing "less than", "greater than", etc is not supported out of the box.

It also seems that you cannot extend/override the filtering logic without editing the source code.

zed
  • 2,298
  • 4
  • 27
  • 44