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
301-320 / 500 Alle rijen tonen
301autem perspiciatisSit enim itaque in earum cumque est et.No2016-02-10Edit
302eligendi velVel iste ea at sapiente eligendi inventore laudantium quas.No2016-08-07Edit
303eosInventore nulla ut voluptatum quisquam ipsa voluptatem iste et.No2016-07-11Edit
304voluptatibus minimaEa exercitationem molestiae magni corrupti quis aperiam et repellat.No2016-09-24Edit
305dolorem harumAspernatur expedita accusantium quaerat fuga recusandae accusamus non.No2016-02-01Edit
306omnis voluptatem abProvident sapiente odio distinctio et harum vel.No2016-10-19Edit
307omnisCum ducimus rerum officiis nihil quam.No2016-06-04Edit
308optio idVero non non saepe.No2016-05-10Edit
309architecto esse autNisi quam et amet dolorem in assumenda.No2016-02-12Edit
310quis modiFacere quia molestiae eos.No2016-10-25Edit
311nihil maximeEst ducimus culpa aut aut.No2016-05-01Edit
312repellendus perferendis vitaePariatur officia maxime libero ut vel dolor delectus.No2016-08-04Edit
313impeditOptio repellat sapiente est excepturi.No2016-03-23Edit
314facere adipisci doloresImpedit recusandae pariatur dolores asperiores et quibusdam.No2016-09-03Edit
315autemSapiente sit est laboriosam quo officiis ab.No2016-07-08Edit
316at enim ullamUt minima dolor molestias ut.No2016-06-06Edit
317nulla perspiciatis sapienteDolor voluptatibus aut ipsa ad ut.No2016-09-20Edit
318beataeQuaerat veniam architecto est.No2016-03-19Edit
319et voluptatemDicta vel deleniti quasi enim laudantium repudiandae est sint.No2016-03-23Edit
320quo corrupti autSunt voluptatem corrupti est molestias id porro.No2016-03-05Edit

Fork me on GitHub