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
201-220 / 500 show all
201voluptasEt ut autem at ex voluptatibus assumenda.No2016-05-27Edit
202beataeVel cupiditate quis autem.No2016-08-19Edit
203soluta possimus estIllum ut molestiae et officia aut earum.No2016-02-20Edit
204error earum quiAb labore rerum quisquam rerum enim magni.No2016-08-28Edit
205velAut corrupti facere omnis officia.No2016-10-26Edit
206quia ipsum maximeEum quia expedita quo quia.No2016-01-09Edit
207sunt laborum cupiditateTempore laborum veniam non iure non minima.No2016-05-23Edit
208officiaTemporibus nulla vero voluptatum repudiandae.No2016-08-08Edit
209fugaA amet qui quas aliquam neque.Yes2016-03-01Edit
210molestiaeCommodi soluta deleniti magni nisi error voluptas.No2016-05-06Edit
211et dictaExpedita tempore numquam unde ut quaerat iure est.No2016-01-17Edit
212quis veniamNam consequatur similique doloribus tempore tenetur recusandae ex.Yes2016-09-21Edit
213quod reprehenderitIn ex fuga voluptas dolores accusamus architecto.No2016-10-06Edit
214eumUt dolor qui dolore.No2016-04-26Edit
215aliquid sed suntQuis sed voluptate voluptatibus voluptatem doloremque et.Yes2016-07-29Edit
216nihil vitae eaNobis tenetur qui occaecati voluptas quibusdam.No2016-04-09Edit
217facere providentMagnam est quis sunt.No2016-08-21Edit
218quaerat sequiDeserunt et rem ut.No2016-10-10Edit
219corrupti magni voluptatemFugit ut nihil quae quaerat qui.No2016-04-22Edit
220vero rerumEt aliquid id sed et.No2016-03-31Edit

Fork me on GitHub