1

Hi I'm writing a web app using rails and as part of it I am displaying data to the user using jQuery Bootgrid. As part of this the user is able to set the number of rows per page of the table. I'd like to be able to have this setting persist between page loads.

When a user chooses an option for the number of rows to display I am able to capture that and store in a model. However Bootgrid doesn't seem to have a simple way of programmatically setting the number of rows. This seems like a common thing to want to do so if anyone has come across this before and can give some help it would be greatly appropriated.

user2320239
  • 1,021
  • 2
  • 18
  • 43

2 Answers2

0

you can find a "setRowCount" implemented in

https://github.com/rstaib/jquery-bootgrid/issues/215 - jquery.bootgrid.modified.txt

Unfortunately the user didn't see fit to properly fork the repo.

0

Not my best code but it is working:

With jquery fire click event of number of rows that you want...

$("#grid-basic1-header .dropdown:visible [data-action='-1']").click();
Zvi Redler
  • 1,708
  • 1
  • 18
  • 29