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
401-420 / 500 show all
401cum deserunt nesciuntMolestiae quasi totam voluptatem in esse dignissimos ut.Yes2016-03-04Edit
402atReiciendis ut reprehenderit occaecati quia voluptatum error debitis.No2016-04-29Edit
403et praesentium temporeAccusamus omnis odit in cumque soluta aliquam.No2016-10-20Edit
404at aliquam corruptiVitae ut excepturi earum eum officia quidem repellat perspiciatis.No2016-01-27Edit
405magni excepturiNon inventore non placeat incidunt cum.No2016-10-19Edit
406sequi beataeSit velit consequuntur minus possimus.No2016-01-21Edit
407similique voluptatumVoluptatem nesciunt quos omnis.No2016-10-05Edit
408quibusdam voluptatePerferendis sit rerum aliquam ullam et quia nemo.No2016-04-16Edit
409dolore etAut sequi veniam eius eveniet.No2016-05-02Edit
410et qui sintVoluptatem recusandae dicta cumque vitae.No2016-05-14Edit
411iureVelit error et fugiat fuga provident debitis expedita.No2016-02-23Edit
412nonPerferendis consequatur error doloremque non voluptas sed aspernatur animi.No2016-03-21Edit
413voluptateAnimi esse amet nihil ad nobis voluptatum.No2016-03-10Edit
414quo architecto nonLaudantium iusto dolor facere vero provident sunt.Yes2016-01-07Edit
415voluptatemAccusantium mollitia dolorem nesciunt ipsa libero dolor.No2016-06-16Edit
416ipsamSit dolore accusantium maxime.Yes2016-07-14Edit
417provident eumEos temporibus animi voluptate quia a aut vel.No2016-01-14Edit
418cupiditate ut illumExpedita ut ut molestiae officia voluptatem.No2016-10-24Edit
419voluptatem rerumOmnis eos labore nulla temporibus provident ratione sed excepturi.Yes2016-01-24Edit
420rem nequeExpedita voluptatibus commodi dignissimos sed voluptatum modi voluptas.No2016-06-14Edit

Fork me on GitHub