Class: Netzke::Communitypack::OneToManyExplorer

Inherits:
Base
  • Object
show all
Includes:
Basepack::ItemPersistence
Defined in:
lib/netzke/communitypack/one_to_many_explorer.rb

Overview

2 grids - “container” and “collection” - bound with a one-to-many relationship. The collection model should implement belongs_to in respect to the container model.

Accepts the following config options:

  • foreign_key (required) - foreign key that defines the one-to-many relation

Override :container and :collection components if you want to customize the corresponding grids, e.g.:

component :container do |c|
  c.klass = ProjectGrid
  c.region = :north
  c.height = 200
  super c
end

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.server_class_config_optionsObject



27
28
29
# File 'lib/netzke/communitypack/one_to_many_explorer.rb', line 27

def self.server_class_config_options
  [*super, :container_config, :collection_config]
end

Instance Method Details

#configure(c) ⇒ Object



31
32
33
34
# File 'lib/netzke/communitypack/one_to_many_explorer.rb', line 31

def configure(c)
  c.items = [:container, :collection]
  super
end