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
221-240 / 500 Sýna allt
221sequiQuo nobis aut ut dolor perferendis odit.No2016-07-04Edit
222voluptasAnimi odio ad et nisi quod perferendis natus possimus.No2016-01-17Edit
223laboriosam aut etEt possimus dicta hic sunt et itaque facilis.No2016-03-24Edit
224quia illum natusIpsam alias necessitatibus quaerat.No2016-05-07Edit
225beatae porroAut mollitia et ut.No2016-10-14Edit
226ex aperiamSed iusto quisquam nostrum.No2016-02-19Edit
227et voluptatibusEt corporis voluptas quam harum praesentium.No2016-10-12Edit
228reprehenderitDeleniti non necessitatibus voluptas.No2016-10-13Edit
229omnis commodiArchitecto qui voluptatum vel et.No2016-04-26Edit
230aliquid rerum modiFugit hic blanditiis esse alias.Yes2016-07-20Edit
231quia quisCupiditate error facilis qui nobis modi hic.Yes2016-10-17Edit
232eos quam doloremEt aspernatur voluptatem qui commodi esse.No2016-08-28Edit
233nesciunt suscipit quisDicta vel atque occaecati quisquam qui est tempora.Yes2016-05-23Edit
234quidem corporisAut velit earum velit assumenda.No2016-02-07Edit
235sunt ametHic similique sit cupiditate.No2016-09-26Edit
236consequatur quisquamMinus mollitia ab quia soluta provident aut tempora aut.No2016-05-26Edit
237vel esseDistinctio accusamus et dolores aliquam repudiandae omnis.No2016-10-10Edit
238namDolor culpa laboriosam enim omnis ipsa.No2016-10-06Edit
239nesciuntHarum quo vel maiores praesentium non sit sapiente fugiat.No2016-08-07Edit
240illoMolestias nostrum quis itaque sed.No2016-01-26Edit

Fork me on GitHub