class ExtNumbercolumn

Public Class Methods

new(config, parent) click to toggle source
Calls superclass method ExtNode::new
# File lib/extclasses/numbercolumn.rb, line 9
def initialize(config, parent)

  @default_config = {
    :align => "right", 
    :sortable => true,
    :format => "0,000"
  }

  super "numbercolumn", config, parent
end

Public Instance Methods

to_extjs(at_deep = 0) click to toggle source
Calls superclass method ExtNode#to_extjs
# File lib/extclasses/numbercolumn.rb, line 20
def to_extjs(at_deep = 0)
  if self.child_of? "editorgrid"
    if @config[:editor].nil?
      @config.merge! :editor => { :xtype => "numberfield" }
    else
      @config[:editor].merge! :xtype => "numberfield", :format => @config[:format] || "0,000.00"
    end
  end
  super at_deep 
end