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
381-400 / 500 Alle rijen tonen
381eosId quia ipsa laudantium.No2016-05-12Edit
382vel nostrumMaiores officiis sequi aut at quia.No2016-07-19Edit
383omnis vel delectusDolorem amet et et in iusto autem occaecati.No2016-02-17Edit
384quiaNihil voluptas unde voluptas nobis.No2016-03-12Edit
385et teneturDelectus consectetur vitae dicta eveniet.No2016-09-06Edit
386eveniet ipsam etExpedita maiores natus ab voluptatem nesciunt.No2016-07-26Edit
387sedMolestias aut iusto aliquid.No2016-07-10Edit
388aspernatur dolores velIn velit quis optio exercitationem aspernatur et pariatur.No2016-02-27Edit
389utVoluptatem hic sapiente perspiciatis quos expedita et velit.No2016-07-23Edit
390voluptas ut etEst eos omnis doloremque aut.No2016-05-01Edit
391aut estVelit distinctio necessitatibus culpa debitis non eos molestiae rerum.No2016-10-21Edit
392velit vitaeVero tenetur ex et totam nam natus aperiam doloremque.No2016-08-27Edit
393nihilAut non incidunt omnis assumenda.Yes2016-06-18Edit
394minus facilisNulla repellat optio ea ut.No2016-08-04Edit
395quia nobis quidemQuia quis repellendus eos adipisci.No2016-05-23Edit
396at consequatur quaeratNostrum enim iusto architecto numquam.No2016-02-24Edit
397tempore ut aliquidLaudantium labore perferendis ut doloremque.Yes2016-07-01Edit
398dolores sitEt quae alias vitae sint autem eaque.No2016-09-20Edit
399rerum quaeUt quisquam molestiae at aut.No2016-03-24Edit
400et voluptatibusQui aliquam et quia.No2016-08-15Edit

Fork me on GitHub