Sha256: a8ae673e34099c1fee19d287d8cf63c9794f44db084a15ea0a52e0c0dca9ec43

Contents?: true

Size: 1.07 KB

Versions: 6

Compression:

Stored size: 1.07 KB

Contents

class Example1 < Datatable::Base

  sql <<-SQL
      SELECT
        orders.id,
        orders.order_number,
        customers.first_name,
        customers.last_name,
        orders.memo
      FROM
        orders
      JOIN
        customers ON customers.id = orders.customer_id
  SQL

  columns(
    {"orders.id" => {:type => :integer, :sTitle => "Id", :sWidth => '50px'}},
    {"orders.order_number" => {:type => :integer, :link_to => link_to('{{1}}', order_path('{{0}}')),:sTitle => 'Order Number', :sWidth => '125px'  }},
    {"customers.first_name" => {:type => :string, :link_to => link_to('{{2}}', order_path('{{0}}')),:sWidth => '200px' }},
    {"customers.last_name" => {:type => :string,:sWidth => '200px'}},
    {"orders.memo" => {:type => :string }}
  )
  option('individual_column_searching', true)
  #option('sDom', '<"H"lrf>t<"F"ip>')    # use with pagination
  
  # to use pagination comment out following and enable previous line
  option('sDom', '<"clear"><"H"Trf>t<"F"i>')
  option('bScrollInfinite', true)
  option('bScrollCollapse', true)
  option('sScrollY', '200px')
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
datatable-0.2pre6 example_app/app/datatables/example1.rb
datatable-0.2pre5 example_app/app/datatables/example1.rb
datatable-0.2pre4 example_app/app/datatables/example1.rb
datatable-0.2pre3 example_app/app/datatables/example1.rb
datatable-0.2pre2 example_app/app/datatables/example1.rb
datatable-0.2pre1 example_app/app/datatables/example1.rb