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
281-300 / 500 show all
281velitDolorum quaerat asperiores itaque quibusdam libero aspernatur sed eius.No2016-02-14Edit
282explicabo illumEt rem occaecati voluptatem ullam et error.No2016-04-30Edit
283quamVoluptatem id dolore non.No2016-04-21Edit
284illo explicaboVel quibusdam quia repellendus eligendi at.No2016-09-22Edit
285iure veniam numquamVoluptas eius possimus eos voluptates asperiores voluptatem perferendis.No2016-02-02Edit
286excepturi deleniti corporisRepudiandae inventore neque et.No2016-06-07Edit
287sint non dolorAb aut rerum ut sequi tenetur voluptate repellat non.No2016-05-10Edit
288consectetur dolores delectusQuia vel vitae dolorum iusto illo velit.No2016-07-26Edit
289quasiQui est mollitia minus tempore eaque perferendis non.No2016-03-08Edit
290voluptasIste aut occaecati quo voluptates facere consequatur.No2016-01-15Edit
291odio fugit etCupiditate repudiandae corrupti sed culpa cumque vitae aut et.No2016-06-22Edit
292excepturi hicEsse saepe deserunt ipsam.No2016-01-29Edit
293sed est estUllam dolores iste ut perspiciatis necessitatibus id illo.Yes2016-06-27Edit
294fugiat evenietAccusamus ut et nesciunt sit corrupti.No2016-06-10Edit
295itaque velitVoluptatem rerum non expedita illum et quod.No2016-02-01Edit
296cupiditate in minimaSit aspernatur tempore id.Yes2016-03-17Edit
297dolores magnam eosAsperiores possimus modi sint et quia.No2016-01-25Edit
298iusto quae ipsamEa nihil vel ea.No2016-06-14Edit
299consequaturExercitationem voluptatem sint ad.No2016-03-16Edit
300minimaConsequatur nesciunt tempora asperiores quo ipsa repudiandae qui dolorem.Yes2016-06-09Edit

Fork me on GitHub