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 -%>
    
ID TitleDescriptionArchivedDue Date
1-20 / 500 Alle rijen tonen
1impedit aperiam liberoEst necessitatibus tempora ut.No2016-07-27Edit
2ut sintAssumenda ut in commodi nihil ratione odio voluptatibus ea.No2016-10-21Edit
3aliquam repudiandaeConsequatur iste similique dolorum ducimus ut.No2016-04-20Edit
4nisi quiQuas assumenda eos molestiae recusandae eveniet sit sint.No2016-05-16Edit
5dicta pariaturCorporis iure repellat fuga omnis alias iusto aut voluptatum.No2016-03-04Edit
6molestiae autemExplicabo aut ratione omnis voluptatem officia itaque dicta aut.Yes2016-10-26Edit
7ut veniamMolestiae qui qui quo occaecati.No2016-08-04Edit
8nullaNatus sint inventore culpa fugiat occaecati est distinctio.No2016-05-22Edit
9quisquam in isteEt fugiat blanditiis facilis asperiores et.No2016-03-07Edit
10rerum occaecatiCum aperiam voluptas aut.No2016-08-14Edit
11aspernatur estVoluptatem error inventore officia rem nemo qui.Yes2016-06-21Edit
12explicabo hicPorro in nisi ea sunt consequatur est incidunt et.No2016-04-15Edit
13utEst voluptas impedit perferendis excepturi aliquid doloremque.No2016-07-18Edit
14repellat consequatur velitError autem et deleniti nihil maxime voluptatem eius eveniet.No2016-01-10Edit
15est ut autVero distinctio voluptatem veritatis.No2016-10-30Edit
16omnisPossimus voluptas tempore sed mollitia neque vero nesciunt.No2016-02-05Edit
17itaque suscipit commodiEt ut eveniet deleniti voluptatem omnis ea magnam et.No2016-08-23Edit
18necessitatibus commodiLabore dolor et cumque quos.No2016-03-28Edit
19id rem eaIn odio quia laborum quam dicta nulla.Yes2016-04-14Edit
20aspernatur eligendi adipisciMaiores perspiciatis tempore et aut sapiente eaque.No2016-06-08Edit

Fork me on GitHub