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
41-60 / 500 show all
41estIpsum illo corrupti nesciunt facere.No2016-04-09Edit
42autEt eaque dignissimos magnam.No2016-08-25Edit
43impedit atque minimaAperiam expedita autem porro enim veniam.Yes2016-08-15Edit
44id temporibus eligendiId dignissimos dolorem enim ut.No2016-03-11Edit
45rerumRepellat et ut eos ea illo et dolorum voluptatem.No2016-03-06Edit
46facereEst nesciunt molestiae labore ut.Yes2016-09-21Edit
47temporibus iure delectusCumque placeat aut vel repellat omnis accusamus error odio.No2016-02-11Edit
48qui inciduntDignissimos harum ut ea veritatis ut.No2016-08-02Edit
49laborumFacere perferendis sapiente atque.No2016-09-28Edit
50ipsum nam temporeBlanditiis totam ab aut.No2016-03-23Edit
51harum qui possimusNemo odio id ut quam praesentium esse.No2016-08-24Edit
52eos temporibus omnisSapiente accusamus recusandae sunt animi voluptates dolorem enim.No2016-05-23Edit
53molestiaeConsequatur explicabo quos unde esse a distinctio sapiente voluptas.No2016-06-04Edit
54minima in voluptatemFacilis vitae et voluptatem similique quas dolore ipsam.No2016-10-04Edit
55dolorError odio possimus labore.No2016-04-10Edit
56sitVoluptate enim perspiciatis nihil nisi necessitatibus quo dignissimos.No2016-09-10Edit
57nequeNisi mollitia ipsam autem est voluptas consequatur expedita.No2016-05-24Edit
58atque etEst alias est non debitis omnis voluptatem.No2016-03-29Edit
59alias liberoRepudiandae praesentium aut nobis saepe.No2016-01-09Edit
60voluptas repellendusTempora suscipit quibusdam rerum expedita aut.No2016-05-02Edit

Fork me on GitHub