Module: JqGridRails::Generators

Defined in:
lib/jqgrid_rails/jqgrid_rails_generators.rb

Instance Method Summary collapse

Instance Method Details

#jq_grid(grid) ⇒ Object Also known as: jqgrid

grid

JqGridRails::JqGrid instance

Outputs javascript to build grid



6
7
8
# File 'lib/jqgrid_rails/jqgrid_rails_generators.rb', line 6

def jq_grid(grid)
  self << grid.build
end

#reload_grid(dom_id) ⇒ Object

dom_id

DOM ID of grid

Instructs grid to reload itself



13
14
15
16
# File 'lib/jqgrid_rails/jqgrid_rails_generators.rb', line 13

def reload_grid(dom_id)
  dom_id = "##{dom_id}" unless dom_id.start_with?('#')
  self << "jQuery('#{dom_id}').trigger('reloadGrid');"
end