leikind / wice_grid

A Rails grid plugin to create grids with sorting, pagination, and (automatically generated) filters
MIT License
535 stars 215 forks source link

Use turbolinks:load as documented #346

Closed allolex closed 5 years ago

allolex commented 7 years ago

The grid column filter requires the page to be refreshed on a Rails 4.2.8 project.

Loading Turbolinks via the turbolinks:load handler fixes this problem.

https://github.com/turbolinks/turbolinks#running-javascript-when-a-page-loads

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 37.452% when pulling 9bc47a7a42517c73f65130ebafd7ee847133e406 on allolex:rails4 into f065b915ed29108fbd0e1286798b005691e505ad on leikind:rails3.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 37.452% when pulling 9bc47a7a42517c73f65130ebafd7ee847133e406 on allolex:rails4 into f065b915ed29108fbd0e1286798b005691e505ad on leikind:rails3.

patricklindsay commented 6 years ago

Using the current implementation it should not have to be refreshed. As taken from the Turbolinks docs:

turbolinks:render fires after Turbolinks renders the page. This event fires twice during an application visit to a cached location: once after rendering the cached version, and again after rendering the fresh version. link

Please provide a working example of the problem. Your suggested solution would not work if javascript is asynced or turbolinks is disabled. turbolinks:renderI don't think this is the right solution.