Class: ExtCurrency

Inherits:
ExtNode show all
Includes:
FormField
Defined in:
lib/extplugins/currency.rb

Overview

depend on extjs currenct plugin

Constant Summary collapse

@@ALIAS_CONFIG =
{
  :text => :fieldLabel
}

Instance Attribute Summary

Attributes inherited from ExtNode

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

Instance Method Summary collapse

Methods included from FormField

included

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, #to_extjs

Constructor Details

#initialize(config, parent) ⇒ ExtCurrency

Returns a new instance of ExtCurrency.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/extplugins/currency.rb', line 10

def initialize(config, parent)
  @default_config = {
    :width => 150,
    :cls => "number",
    :plugins => [{ ptype: "currency" }, { ptype: "multiple_validations"}],
    :currencyConfig => {}
  }

  if config[:decimalPrecision]
    @default_config[:currencyConfig].merge!({ :decimalPrecision => config[:decimalPrecision] })
    config.delete :decimalPrecision
  end

  super "textfield", config, parent 
end