# File lib/model/base.rb, line 291
      def extjs_field(field, config=nil)  
        if config.kind_of? Hash
          if config.has_key?(:mapping) && config.has_key?(:parent_trail)
            field.update( # <-- We use a template for rendering mapped field-names.
              :name => config[:parent_trail].to_s + self.extjs_parent_trail_template.call(field[:name]),
              :mapping => "#{config[:mapping]}.#{field[:name]}"
            )
          end
          field.update(config.except(:mapping, :parent_trail))
        elsif !config.nil?  # <-- Hopfully an ORM Column object.
          field.update(
            :allowBlank => self.extjs_allow_blank(config),
            :type => self.extjs_type(config),
            :defaultValue => self.extjs_default(config)
          )
          field[:dateFormat] = "c" if field[:type] === "date" && field[:dateFormat].nil? # <-- ugly hack for date  
        end  
        field.update(:type => "auto") if field[:type].nil?
        # convert Symbol values to String values
        field.keys.each do |k|
          raise ArgumentError, "extjs_field expects a Hash as first parameter with all it's keys Symbols. Found key #{k.inspect}:#{k.class.to_s}" unless k.is_a?(Symbol)
          field[k] = field[k].to_s if field[k].is_a?(Symbol)
        end
        field
      end