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
261-280 / 500 show all
261cumque voluptasQuod distinctio iusto quia quas voluptatem est.No2016-08-03Edit
262eosQuia ea eos qui omnis odio et.No2016-08-05Edit
263nonFugit possimus ut aut.No2016-04-13Edit
264magnam laboriosamTemporibus laborum sapiente cupiditate sed porro consequuntur.No2016-04-12Edit
265reprehenderit voluptasProvident explicabo exercitationem quia voluptates.No2016-10-12Edit
266estEum quam et quia laudantium.No2016-09-20Edit
267quoId exercitationem laudantium nemo amet.No2016-10-15Edit
268quasi minima magniConsequuntur aspernatur eos cumque facere.No2016-10-05Edit
269culpa assumendaOmnis voluptatem atque et mollitia a.No2016-06-15Edit
270modi minusIllo voluptas eum dolorem accusantium deleniti aliquam.No2016-03-26Edit
271etNatus deserunt quibusdam rerum.Yes2016-10-11Edit
272fugit maiores consequaturQuasi velit amet iure blanditiis ipsam in qui.No2016-08-03Edit
273veroMinima eum dicta odio a quod odit rerum.Yes2016-06-13Edit
274eos sint ametVitae nihil et quos aliquam possimus porro qui.No2016-08-07Edit
275voluptatumEsse magnam ut repellendus.No2016-06-21Edit
276sedEa provident inventore minima quis.No2016-07-18Edit
277magni officia inciduntEveniet magnam alias mollitia sit facere in deserunt autem.No2016-09-07Edit
278itaqueEveniet quam sint occaecati qui expedita asperiores.Yes2016-01-19Edit
279et sitExpedita repudiandae accusantium necessitatibus aliquid quis aliquam.No2016-07-05Edit
280corporisVoluptate et necessitatibus distinctio et.No2016-05-30Edit

Fork me on GitHub