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
241-260 / 500 Voir tous
241blanditiis natusImpedit sit ea ut et.No2016-06-07Edit
242quia doloremque perspiciatisExpedita perspiciatis quos dolor at in quae impedit doloremque.No2016-07-01Edit
243molestiae similiqueLabore et dolor architecto dolorum aut recusandae.No2016-05-29Edit
244autem sintEarum quibusdam rerum amet quae laudantium.Yes2016-06-30Edit
245iure utDolores veniam quia sint est a.No2016-07-04Edit
246eos laborumDelectus assumenda sint praesentium est.No2016-03-12Edit
247eum temporeDignissimos cumque rem dolores voluptatem numquam omnis unde autem.No2016-10-13Edit
248quiMinus quia cumque est deleniti.Yes2016-10-25Edit
249sint itaqueNeque cum vero laborum voluptatem aliquam velit quaerat voluptatem.Yes2016-02-09Edit
250id culpa aliquidMagni possimus corrupti sed voluptatem earum harum ipsum.No2016-10-22Edit
251odit praesentiumAt saepe ipsa officiis ut minus est et nemo.No2016-07-14Edit
252quasi etSunt atque in necessitatibus officia dolorum.No2016-02-18Edit
253quosAut fuga qui excepturi ut tempora dolor voluptatem.Yes2016-01-08Edit
254ex estIpsa enim provident quia.Yes2016-02-11Edit
255qui suscipitRerum quia itaque amet eum veniam aut ad.No2016-10-01Edit
256saepeEarum facere omnis voluptatem dolor ad.No2016-02-15Edit
257et nihilVoluptatibus sit et saepe eum harum et.No2016-04-14Edit
258quia fugiatQuae vero fuga omnis at possimus cupiditate ut molestiae.No2016-04-29Edit
259suntEos recusandae ut provident voluptas consequatur enim.No2016-02-29Edit
260voluptates dolorem officiaSint quidem vel asperiores.No2016-08-29Edit

Fork me on GitHub