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
441-460 / 500 Alle rijen tonen
441in autRatione quam eveniet corporis.No2016-08-25Edit
442ut voluptatemQuibusdam et veniam ut.No2016-07-26Edit
443ullam laudantium commodiEaque tempora non quia sit quia perspiciatis mollitia.No2016-10-25Edit
444asperiores quisIure est soluta deserunt sunt.Yes2016-02-29Edit
445delectusOptio aut tempora mollitia corporis dicta temporibus eum vitae.No2016-08-29Edit
446ut et sitUt voluptatem est facere quasi.No2016-07-06Edit
447animi accusantium utSequi dolorem distinctio sit doloremque et corporis voluptatem alias.No2016-10-15Edit
448tempore aliquam rationeQuam rerum tenetur aliquid.No2016-01-21Edit
449dolores sedVoluptatibus et excepturi molestiae.No2016-01-31Edit
450distinctio aspernaturVel perspiciatis exercitationem dolorem ducimus.No2016-05-16Edit
451expedita nihilVoluptate maiores et sapiente.No2016-08-01Edit
452illum et voluptatemAccusamus quis quis sapiente distinctio aut et quaerat asperiores.Yes2016-02-03Edit
453omnisBlanditiis optio in inventore qui consequatur et.No2016-05-19Edit
454similique enim odioEa cupiditate sit ex aut laudantium voluptatem.No2016-01-11Edit
455etRerum unde adipisci praesentium ut dolore ea quia debitis.No2016-06-10Edit
456inventore voluptasQuis molestiae ipsa omnis blanditiis ut dolores.No2016-04-01Edit
457asperiores qui nonIllum consequatur laboriosam iusto praesentium sed dolore.No2016-05-16Edit
458quisUt corrupti consequatur iste.No2016-08-18Edit
459et rerumExplicabo totam asperiores cupiditate ea dolore ipsam.No2016-09-15Edit
460consequatur nemoVel minus voluptatem facere voluptatem sit.No2016-08-03Edit

Fork me on GitHub