bogdan / datagrid

Gem to create tables grids with sortable columns and filters
MIT License
1.02k stars 116 forks source link

Preserve Current URL Params on Sort or Filter #234

Closed shahidify closed 7 years ago

shahidify commented 7 years ago

Hi, First, I must say, this is a really nice datagrid implementation and very active responses on the issues raised. I am not sure if this issue is already addressed. ( I already checked but could not find.)

Issue I am facing - when I sort a column, I lose existing URL Params. for example - localhost/expenses?param1=one&param2=two
when I sort grid, it changes to __localhost/expenses?expenses_grid%5Bdescending%5D=false&expenses_grid%5Border%5D=expensetitle

Is there a way to preserve (or append) existing URL params?

Thanks!

joemsak commented 7 years ago

Came here to search for this issue :)

bogdan commented 7 years ago

@joemsak @mshahidkhan fixed an issue in master. Please check if the fix works for you and I'll make a release

shahidify commented 7 years ago

Thanks @bogdan I am getting an error on 'request' used in renderer.rb undefined local variable or method 'request' for #<Datagrid::Renderer:0x6ccdb701>

Am I missing anything here ?

bogdan commented 7 years ago

One more attempt to fix. Try current master.

shahidify commented 7 years ago

Bingo! The fix works. Thanks a lot. 👍 Could you please make an official release.