Class: ExtUtil

Inherits:
Object
  • Object
show all
Defined in:
lib/extjsml/ext_util.rb

Constant Summary collapse

ALIAS_TABLE =

TODO move to file

{
  :tab => :tabpanel,
  :div => :container,
  # column alias
  :gtext => :gridcolumn,
  :gboolean => :booleancolumn,
  :gnumber => :numbercolumn,
  :gdate => :datecolumn,
  :gtemplate => :templatecolumn,
  :gaction => :actioncolumn,
  :gcurrency => :currencycolumn,
  :gcheck => :checkcolumn
}
CONTAINER_XTYPE =
[
  "div",
  "container",
  "panel",
  "tabpanel",
  "form",
  "fieldset",
  "fieldcontainer"
]
DATA_COLUNMS =
[
  "gridcolumn",
  "numbercolumn",
  "booleancolumn",
  "datecolumn",
  "currencycolumn",
  "numericcolumn"
]
FIELD_XTYPE =
[  
    "fieldcontainer",
    "fileuploadfield",         
    "checkbox",         
    "checkboxgroup",    
    "combo",            
    "compositefield",
    "datefield",
    "displayfield",     
    "field",            
    "fieldset",         
    "hidden",           
    "htmleditor",       
    "label",            
    "numberfield",      
    "radio",            
    "radiogroup",       
    "textarea",         
    "textfield",        
    "timefield",        
    "trigger",

    "uxaccount",
    "uxsettlement",
    "uxchq",
    "uxbroker"
]

Class Method Summary collapse

Class Method Details

.all_xtypeObject



216
217
218
# File 'lib/extjsml/ext_util.rb', line 216

def self.all_xtype
  return String.get_all_xtypes
end

.container_xtypeObject



208
209
210
# File 'lib/extjsml/ext_util.rb', line 208

def self.container_xtype
  CONTAINER_XTYPE    
end

.data_xtypeObject



204
205
206
# File 'lib/extjsml/ext_util.rb', line 204

def self.data_xtype
  DATA_COLUNMS
end

.field_xtypeObject



200
201
202
# File 'lib/extjsml/ext_util.rb', line 200

def self.field_xtype
  FIELD_XTYPE 
end

.FontWidthRatioObject



212
213
214
# File 'lib/extjsml/ext_util.rb', line 212

def self.FontWidthRatio
  9 
end

.random_idObject



221
222
223
# File 'lib/extjsml/ext_util.rb', line 221

def self.random_id
  "_" + SecureRandom.urlsafe_base64.gsub(/\d|\W/,'')
end

.xtype_alias(xtype) ⇒ Object



196
197
198
# File 'lib/extjsml/ext_util.rb', line 196

def self.xtype_alias(xtype)
  ALIAS_TABLE[xtype.to_sym] || xtype
end