Text Input pagination plugin with Bootstrap
Text Input pagination plugin with Bootstrap
mlewis001
Posts: 3Questions: 1Answers: 0
Using DataTables 1.9.3 with Bootstrap. User has asked for Input style pagination. I've downloaded the plugin but I'm having difficulty figuring out how to get it to render in Bootstrap. We are using the legacy bootstrap integration plug-in which gives us First Prev Next Last buttons along with page hyperlinks but I want to add Input box. Upgrading to 1.10 isn't yet an option but may be the only answer. Thanks!
This discussion has been closed.
Answers
If you mean this:
initialised thus:
it's working ok for me with Bootstrap - I get buttons and an input box. I don't think DataTables' Bootstrap styling integration covers the pagination plug-ins, but that doesn't bother me.
Correct - if you want the input pagination control to be styling when Bootstrap pagination, you would need to modify the code to suit that.
If you do so, I'm sure others would appreciate if you posted your code.
Allan
Thanks for the replies. I'm just stupid. The page I was testing only had one page of data, so the controls were being hidden by the input plugin itself. D'uh. I will try to modify the plugin to be more bootstrap friendly. If I get it right, I'll post the code here.
Here's the enhanced code to render in Bootstrap. Note that the input controls appear to the right of the buttons as opposed to being embedded between them. I tried for a bit to change this but my users were fine with the way it looked so I stopped. Only a few changes to the original code - used li elements instead of spans, added prevent default to click functions, and included some CSS to shorten the input box width. Note - due to character limit restriction on posts, this code block does not contain the $(nInput) keyup function. That should be included from original source!
Nice one - thanks for sharing it with us!
Allan