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
461-480 / 500 show all
461dolor voluptasItaque quibusdam repellat in.No2016-06-06Edit
462provident doloremque laudantiumVoluptas nihil enim placeat.No2016-01-22Edit
463excepturiNobis doloribus eos aut voluptatem eaque.No2016-08-22Edit
464culpaError deleniti qui quaerat sint.No2016-04-17Edit
465totamQui adipisci aspernatur qui non.No2016-03-14Edit
466autIllum corporis occaecati quia quo aut ratione voluptatem.No2016-03-21Edit
467in error praesentiumEarum temporibus quae laudantium.No2016-02-04Edit
468officiisUt a qui quod saepe unde excepturi.No2016-02-28Edit
469natus autemSed deleniti iste et eos magnam delectus in sequi.Yes2016-10-08Edit
470et nonQuia eaque consequatur minima ut pariatur.No2016-07-25Edit
471illo ut evenietSed esse et sit qui iste odit sint ex.No2016-05-09Edit
472perspiciatisNihil qui dolore dignissimos dicta.No2016-03-13Edit
473voluptatum quiBlanditiis quisquam ut eos eum.No2016-03-22Edit
474possimusAut quia quia a et assumenda voluptas.No2016-06-30Edit
475rerum perspiciatis eumSoluta non et temporibus.No2016-06-25Edit
476facere voluptasOccaecati consectetur neque ullam dolores qui.Yes2016-03-14Edit
477et corruptiLabore non ab accusamus culpa aliquam dicta eaque.No2016-06-10Edit
478necessitatibusQui omnis tempora velit.No2016-03-17Edit
479provident exMolestias animi adipisci sed qui sit ducimus ut et.No2016-10-25Edit
480quas sapiente rerumQuos aut dolor error nihil at placeat quia id.No2016-07-10Edit

Fork me on GitHub