Sha256: fd6b89cd7d80453a692f66dd0ee600238d1fb74ce52045162de73b40934e42cc

Contents?: true

Size: 1.46 KB

Versions: 5

Compression:

Stored size: 1.46 KB

Contents

.card.bg-light
  .card-body
    %h2= current_page_title
    %p
      Filters can also be detached from the grid table. This is a 3-step process.

    %ol
      %li
        First, define the grid with helper
        %code define_grid
        instead of
        %code grid
        \. Everything should be done the same way as with
        %code grid, but every column which will have an external filter, add
        %code detach_with_id: :some_filter_name
        in the
        %code column
        definition.
      %li
        Then use
        %code grid_filter(grid, :some_filter_name)
        to render filters.
      %li
        Finally, use
        %code render_grid(@grid)
        to actually output the grid table
        \.

= show_code

= render   'grid'

.row
  .col-md-2
    ID:
  .col-md-10
    = grid_filter @tasks_grid, :id_filter
.row
  .col-md-2
    Title:
  .col-md-3
    = grid_filter @tasks_grid, :title_filter
  .col-md-7
.row
  .col-md-2
    Description:
  .col-md-3
    = grid_filter @tasks_grid, :description_filter
  .col-md-7
.row
  .col-md-2
    Archived:
  .col-md-10
    = grid_filter @tasks_grid, :archived_filter
.row
  .col-md-2
    Due date:
  .col-md-10
    = grid_filter @tasks_grid, :due_date
.row
  .col-md-12
    .external-buttons
      %button.btn.btn-primary.wg-external-submit-button{'data-grid-name' => 'grid'} Submit
      %button.btn.btn-default.wg-external-reset-button{'data-grid-name' => 'grid'} Reset
.row
  .col-md-12

    = render_grid(@tasks_grid)

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
wice_grid-7.1.4 spec/support/test_app/app/views/detached_filters/index.html.haml
wice_grid-7.1.3 spec/support/test_app/app/views/detached_filters/index.html.haml
wice_grid-7.1.2 spec/support/test_app/app/views/detached_filters/index.html.haml
wice_grid-7.1.1 spec/support/test_app/app/views/detached_filters/index.html.haml
wice_grid-7.1.0 spec/support/test_app/app/views/detached_filters/index.html.haml