Class: ExtForm

Inherits:
ExtNode show all
Defined in:
lib/extclasses/form.rb

Instance Attribute Summary

Attributes inherited from ExtNode

#childs, #config, #deep_lvl, #default_config, #parent, #xtype

Instance Method Summary collapse

Methods inherited from ExtNode

#add_child, #apply_config, before_to_extjs, #build_abstract_function, #child_of?, #child_of_form?, #collect_events, #collect_ref, #conv_id_to_label, #conv_id_to_name, #conv_id_to_ref, #do_alias_config, #do_layout, #find, #find_field_elements, #find_parent, #get_all_siblings, get_before_filters, #get_deep, get_events, get_refs, #has_child?, #is_field_element?, #override_config, #prepare_config, #remove_childs, #remove_config, reset_generator_config, #root?, set_generator_config, #set_parent

Constructor Details

#initialize(config, parent) ⇒ ExtForm

include Magic::Toolbar



4
5
6
7
8
9
10
11
12
# File 'lib/extclasses/form.rb', line 4

def initialize(config, parent)
  @default_config = {
    # padding: 10,
    autoHeight: true,
    layout: 'anchor',
    border: false
  }
  super('form', config, parent) 
end

Instance Method Details

#to_extjs(at_deep = 0) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/extclasses/form.rb', line 14

def to_extjs(at_deep = 0)
  if @childs.last.xtype == "toolbar"
    # get only item form toolbar
    @config.merge! :fbar => @childs.last.to_extjs(at_deep + 1)

    @childs.pop
  end

  if @childs.first.xtype == "toolbar"
    @config.merge! :tbar => @childs.first.to_extjs(at_deep + 1)
    @childs.slice!(0)
  end
  if find("paging",{:recursive => 1})
    @config.merge! :bbar => find("paging").to_extjs(at_deep + 1)
    self.remove_childs "paging"
  end

  super at_deep
end