Class: Edgarj::ListDrawer::Normal

Inherits:
Base
  • Object
show all
Defined in:
app/helpers/edgarj/list_drawer.rb

Overview

Drawer for record list in Edgarj CRUD view.

Instance Method Summary collapse

Methods inherited from Base

#draw_column, #draw_column_header

Constructor Details

#initialize(edgarj_drawer, options = {}) ⇒ Normal

Returns a new instance of Normal.



189
190
191
192
# File 'app/helpers/edgarj/list_drawer.rb', line 189

def initialize(edgarj_drawer, options = {})
  super(edgarj_drawer, options)
 #@belongs_to_link  = true    # make link on belongs_to
end

Instance Method Details

#set_path(rec) ⇒ Object

prepare path for the rec, which will be drawn later.



195
196
197
# File 'app/helpers/edgarj/list_drawer.rb', line 195

def set_path(rec)
  @path = @vc.polymorphic_path([@options[:namespace], rec], format: :js)
end

#td_options(rec, col) ⇒ Object

<td> options

add Edgarj.click_listCB() with base result. When the column is parent, do nothing.



203
204
205
206
207
208
209
210
211
# File 'app/helpers/edgarj/list_drawer.rb', line 203

def td_options(rec, col)
  result = super.merge(
      style:  'cursor:pointer;',
      class:  '_edgarj_list_column')
 #if !@parent_rec
    result[:'data-url'] = @path
 #end
  result
end