bogdan / datagrid

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

Fixed Headers for datagrid columns #273

Closed himanshu1591 closed 4 years ago

himanshu1591 commented 4 years ago

Fixed Headers for datagrid columns :

Hi, I was looking for a method to make the headers fixed while scrolling the columns down. Assume a user selected 100 records in a page and when he scrolls down to the 100th row, the header should be there fixed and do not vanish.

I am new to rails so please help. Below is the code which I have in my header partial.

<% grid.html_columns(*options[:columns]).each do |column| %> <%= column.header %> <%= datagrid_order_for(grid, column, options) if column.supports_order? && options[:order]%> <% end %>