Class: Avo::Index::GridItemComponent

Inherits:
BaseComponent
  • Object
show all
Includes:
Fields::Concerns::HasHTMLAttributes, ResourcesHelper
Defined in:
app/components/avo/index/grid_item_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Fields::Concerns::HasHTMLAttributes

#get_html

Methods included from ResourcesHelper

#field_wrapper, #filter_wrapper, #index_field_wrapper, #item_select_all_input, #item_selector_init, #item_selector_input, #resource_grid, #resource_table

Methods inherited from BaseComponent

#has_with_trial

Constructor Details

#initialize(resource: nil, reflection: nil, parent_record: nil, parent_resource: nil, actions: nil) ⇒ GridItemComponent

Returns a new instance of GridItemComponent.



9
10
11
12
13
14
15
16
17
# File 'app/components/avo/index/grid_item_component.rb', line 9

def initialize(resource: nil, reflection: nil, parent_record: nil, parent_resource: nil, actions: nil)
  @resource = resource
  @reflection = reflection
  @parent_record = parent_record
  @parent_resource = parent_resource
  @actions = actions
  @card = Avo::ExecutionContext.new(target: resource.grid_view[:card], resource: resource, record: resource.record).handle
  @whole_html = Avo::ExecutionContext.new(target: resource.grid_view[:html], resource: resource, record: resource.record).handle
end

Instance Attribute Details

#actionsObject (readonly)

Returns the value of attribute actions.



7
8
9
# File 'app/components/avo/index/grid_item_component.rb', line 7

def actions
  @actions
end

#parent_resourceObject (readonly)

Returns the value of attribute parent_resource.



7
8
9
# File 'app/components/avo/index/grid_item_component.rb', line 7

def parent_resource
  @parent_resource
end