Sha256: 6bf20b5ce6aeac466ad9b8da31a03d73518131cb1bf3f2c5708dbc8888c4af31

Contents?: true

Size: 1.56 KB

Versions: 5

Compression:

Stored size: 1.56 KB

Contents

.card.bg-light
  .card-body
    %h2= current_page_title
    %p
      In addition to
      %a{href: integration_with_application_view_index_path}
        %code current_page_records
      and
      %a{href: integration_with_application_view_index_path}
        %code current_page_records
      helpers a callback can be setup in the controller which is executed
      when a grid page is rendered.
      Though the results of that processing is rendered on page, normally such callbacks
      are used for some kind of background processing.
      Please notice that the callback is executed
      %em after
      the controller action and thus all controller instance variables have already been
      injected into the view, that is why the current example has a definition of
      %code @one_page_records
      %em before
      the callback, so that the object is injected into the view and the callback block
      has access to the object as well.

      The callback can be setup separately as a block:
      :plain
        <pre>
        @grid.with_paginated_resultset do |records|
          ...
        end
        </pre>
      or as an argument of
      %code initialize_grid
      where the value is the name of the method to be invoked:
      :plain
        <pre>
        @grid = initialize_grid(Task,
          with_paginated_resultset: :process_records
        )
        </pre>

= show_code

= render   'grid'

.row
  .col-md-12
    .card.bg-light
      .card-body
        = @one_page_records.size
        records on the current page:
        = @one_page_records.map(&:id).to_sentence

Version data entries

5 entries across 5 versions & 1 rubygems

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