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
81-100 / 500 Alle rijen tonen
81ad quo dolorTempora culpa laborum et illum suscipit facilis earum et.No2016-05-18Edit
82utEt debitis enim repellat qui voluptatem a nam nisi.No2016-01-12Edit
83enimUt molestias ducimus dignissimos.No2016-10-14Edit
84doloreOdio laboriosam velit pariatur ea autem distinctio.No2016-05-28Edit
85voluptatibus inventoreHarum aliquam amet et inventore.Yes2016-06-03Edit
86adipisciConsectetur optio rerum facilis explicabo enim consequatur delectus iste.No2016-02-07Edit
87nostrumTempore ad qui velit nihil ipsam.No2016-03-31Edit
88culpaOccaecati aut eum vero quasi dolorem.No2016-10-19Edit
89provident consequatur remSint at soluta earum.No2016-08-20Edit
90commodi et quisConsequatur soluta eligendi et consequatur.No2016-05-30Edit
91quaeratFacere ullam veniam inventore ea.No2016-06-17Edit
92est praesentiumModi pariatur voluptatem perspiciatis.No2016-01-19Edit
93autId vero doloremque animi unde.No2016-09-20Edit
94officiisIllum minus rerum expedita.No2016-02-01Edit
95quibusdam beatae adVoluptas aperiam beatae architecto provident cum.Yes2016-03-06Edit
96impedit explicabo voluptatemHic eveniet pariatur non nostrum.No2016-10-25Edit
97voluptatem facilis etIncidunt dolorem molestias deserunt repellat vero aut.No2016-05-26Edit
98aperiam rerumRerum quaerat eligendi voluptatem.Yes2016-07-19Edit
99solutaOfficiis omnis esse est debitis laboriosam.No2016-10-12Edit
100autem nonMinus autem provident ex culpa sit.No2016-08-04Edit

Fork me on GitHub