Netzke::Actions

Netzke component allows specifying Ext actions. An action can be defined in 2 different ways, both of which result in a method definition like this

    def _<some_action>_action
      ...
    end

The 2 ways to define an action are:

The block can optionally receive the configuration of an action being overridden:

    action :bug_server do |orig|
      {:text => config[:text] + orig[:text], :disabled => orig[:disabled]}
    end

Constants

ACTION_METHOD_NAME

Public Instance Methods

actions() click to toggle source

All actions for this instance

    # File lib/netzke/actions.rb, line 66
66:     def actions
67:       @actions ||= self.class.registered_actions.inject({}){ |res, name| res.merge(name.to_sym => normalize_action_config(send(ACTION_METHOD_NAME % name))) }
68:     end
js_config_with_actions() click to toggle source
    # File lib/netzke/actions.rb, line 70
70:     def js_config_with_actions #:nodoc
71:       actions.empty? ? js_config_without_actions : js_config_without_actions.merge(:actions => actions)
72:     end

Private Instance Methods

auto_collect_actions_from_config_and_js_properties() click to toggle source
    # File lib/netzke/actions.rb, line 85
85:       def auto_collect_actions_from_config_and_js_properties
86:         # res = extract_actions(js_properties)
87:         # puts %Q(!!! res: #{res.inspect}\n)
88:       end
normalize_action_config(config) click to toggle source
    # File lib/netzke/actions.rb, line 75
75:       def normalize_action_config(config)
76:         if config[:icon].is_a?(Symbol)
77:           config[:icon] = Netzke::Core.with_icons ? Netzke::Core.icons_uri + "/" + config[:icon].to_s + ".png" : nil
78:         end
79: 
80:         config[:text] ||= config[:name].humanize
81: 
82:         config
83:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.