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
    
  • .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'
  • <%= 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 -%>
    
IDTitleDescriptionArchivedDue Date
101-120 / 500 show all
101enim ullamTenetur nihil animi provident.No2016-07-12Edit
102inventore eligendi voluptasOdio autem at officia tempora labore.No2016-06-14Edit
103molestiaeLaborum sapiente rerum sit.No2016-04-01Edit
104autemMinima consequatur explicabo deleniti iusto officiis debitis doloremque rerum.No2016-05-23Edit
105autem quiaVelit voluptas impedit officia illo eveniet ullam.Yes2016-06-25Edit
106laboriosam enimVel laborum similique est voluptatem dolor cupiditate.No2016-09-12Edit
107utInventore saepe voluptatibus voluptas dignissimos omnis molestias quisquam.No2016-07-29Edit
108maximeItaque nisi fugiat et molestiae dolorem voluptas.No2016-09-01Edit
109sit amet fugiatVoluptatem nam dolores numquam quisquam.No2016-02-08Edit
110hicVoluptate quia quo sed.No2016-01-11Edit
111sit eaCulpa numquam dolorem corporis corrupti aliquam.Yes2016-04-07Edit
112neque quiAut ipsa aut accusamus quia consequatur ea facilis.No2016-02-25Edit
113exercitationemExplicabo ratione quidem non sunt quibusdam rerum et.No2016-05-28Edit
114dolores liberoId quis dolor natus.No2016-05-27Edit
115sit et estUllam dolorum dolorem placeat doloribus aut ea consequatur.No2016-08-14Edit
116dolorem consecteturNemo voluptate quo cum natus ut dolorum maxime consequuntur.No2016-09-07Edit
117fugitSunt ab optio illo voluptatem adipisci omnis ut earum.No2016-02-12Edit
118hicDolores voluptatem nobis repudiandae consequatur fugiat autem voluptas.No2016-06-07Edit
119quo est aliquidFugiat reprehenderit est quia ducimus voluptatem maiores tempore id.No2016-03-22Edit
120esse voluptas deseruntFugit error sed id rem doloribus.No2016-08-01Edit

Fork me on GitHub