WiceGrid 3.6.0.pre4 examples

Hidden filter panel

show_filters: :when_filtered in grid hides the filter panel but the user can make it visible by clicking on the "Show filter" panel.

When any of the filters is active the filter panel is shown anyway.

  • # encoding: utf-8
    class WhenFilteredController < ApplicationController
      def index
        @tasks_grid = initialize_grid(Task)
      end
    end
    
  • <%= grid(@tasks_grid, show_filters: :when_filtered) do |g|
    
      g.column name:  'ID', attribute: 'id', filter: false
    
      g.column name:  'Title', attribute: 'title'
    
      g.column  name:  'Description', attribute: 'description'
    
      g.column  name:  'Archived', attribute: 'archived' do |task|
        task.archived? ? 'Yes' : 'No'
      end
    
      g.column name:  'Due Date', attribute: 'due_date', filter: false
    
    
      g.column   do |task|
        link_to('Edit', edit_task_path(task))
      end
    end -%>
    
  • .well
      %h2= current_page_title
      %p
        %code show_filters: :when_filtered
        in
        %code grid
        hides the filter panel but the user can make it visible by clicking on the "Show filter" panel.
      %p
        When any of the filters is active the filter panel is shown anyway.
    
    = show_code
    
    .row-fluid
      .col-md-12
        = render   'grid'
IDTitleDescriptionArchivedDue Date
1-20 / 500 show all
325perferendis pariaturEst voluptas explicabo id consequatur autem et voluptatum nobis.No2016-01-06Edit
414quo architecto nonLaudantium iusto dolor facere vero provident sunt.Yes2016-01-07Edit
352autemUt provident voluptates dolor.No2016-01-08Edit
171qui est etEt temporibus sed maiores.No2016-01-08Edit
253quosAut fuga qui excepturi ut tempora dolor voluptatem.Yes2016-01-08Edit
59alias liberoRepudiandae praesentium aut nobis saepe.No2016-01-09Edit
206quia ipsum maximeEum quia expedita quo quia.No2016-01-09Edit
14repellat consequatur velitError autem et deleniti nihil maxime voluptatem eius eveniet.No2016-01-10Edit
366debitis nihil quidemMolestiae est consequatur itaque est maiores vero.No2016-01-10Edit
110hicVoluptate quia quo sed.No2016-01-11Edit
454similique enim odioEa cupiditate sit ex aut laudantium voluptatem.No2016-01-11Edit
178molestias voluptas quiIn tempora quam expedita officiis quod.No2016-01-11Edit
194quoQuis fugiat aperiam sapiente veniam provident odio inventore qui.No2016-01-12Edit
353rerum nam eligendiUt qui omnis at ducimus id non perferendis qui.Yes2016-01-12Edit
82utEt debitis enim repellat qui voluptatem a nam nisi.No2016-01-12Edit
417provident eumEos temporibus animi voluptate quia a aut vel.No2016-01-14Edit
424non autem solutaConsectetur omnis excepturi cum vitae.No2016-01-14Edit
290voluptasIste aut occaecati quo voluptates facere consequatur.No2016-01-15Edit
211et dictaExpedita tempore numquam unde ut quaerat iure est.No2016-01-17Edit
222voluptasAnimi odio ad et nisi quod perferendis natus possimus.No2016-01-17Edit

Fork me on GitHub