Sha256: e36cda6b8fa493ddc5b6cc87620b56b59cd1b9b434d676aed1880dd2d0cb345a

Contents?: true

Size: 1.26 KB

Versions: 28

Compression:

Stored size: 1.26 KB

Contents

:ruby
  effective_datatable_params = {
    id: "#{datatable.to_param}-table-#{Time.zone.now.nsec}",
    class: "#{datatable.table_html_class}",
    data: {
      'effective-form-inputs' => defined?(EffectiveFormInputs),
      'bulk-actions' => datatable_bulk_actions(datatable),
      'columns' => datatable_columns(datatable),
      'input-js-options' => local_assigns[:input_js_options],
      'simple' => datatable.simple?.to_s,
      'source' => effective_datatables.datatable_path(datatable, {format: 'json'}.merge(attributes: datatable.attributes)).chomp('?'),
      'default-order' => datatable_default_order(datatable),
      'display-entries' => datatable.display_entries,
      'display-records' => (datatable.to_json[:recordsFiltered] || 0),
      'total-records' => (datatable.to_json[:recordsTotal] || 0)
    }
  }

%table.effective-datatable{effective_datatable_params}
  %thead
    %tr
      - datatable.table_columns.each do |name, opts|
        %th= opts[:label] || name

  %tbody
    - datatable.to_json[:data].each do |row|
      %tr
        - row.each do |col|
          %td= col.to_s.html_safe

  - if datatable.aggregates.present?
    %tfoot
      - datatable.to_json[:aggregates].each do |row|
        %tr
          - row.each do |col|
            %td= col.to_s.html_safe

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
effective_datatables-2.6.21 app/views/effective/datatables/_datatable.html.haml
effective_datatables-2.11.1 app/views/effective/datatables/_datatable.html.haml
effective_datatables-2.11.0 app/views/effective/datatables/_datatable.html.haml
effective_datatables-2.10.0 app/views/effective/datatables/_datatable.html.haml
effective_datatables-2.9.0 app/views/effective/datatables/_datatable.html.haml
effective_datatables-2.8.0 app/views/effective/datatables/_datatable.html.haml
effective_datatables-2.7.0 app/views/effective/datatables/_datatable.html.haml
effective_datatables-2.6.20 app/views/effective/datatables/_datatable.html.haml
effective_datatables-2.6.19 app/views/effective/datatables/_datatable.html.haml
effective_datatables-2.6.18 app/views/effective/datatables/_datatable.html.haml
effective_datatables-2.6.17 app/views/effective/datatables/_datatable.html.haml
effective_datatables-2.6.16 app/views/effective/datatables/_datatable.html.haml
effective_datatables-2.6.15 app/views/effective/datatables/_datatable.html.haml
effective_datatables-2.6.14 app/views/effective/datatables/_datatable.html.haml
effective_datatables-2.6.13 app/views/effective/datatables/_datatable.html.haml
effective_datatables-2.6.12 app/views/effective/datatables/_datatable.html.haml
effective_datatables-2.6.11 app/views/effective/datatables/_datatable.html.haml
effective_datatables-2.6.10 app/views/effective/datatables/_datatable.html.haml
effective_datatables-2.6.9 app/views/effective/datatables/_datatable.html.haml
effective_datatables-2.6.8 app/views/effective/datatables/_datatable.html.haml