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:
as a hash:
action :bug_server, :text => "Call server", :icon => "/images/icons/phone.png"
as a block:
action :bug_server do
{:text => config[:text], :disabled => true}
end
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
# 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
# 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.
Generated with the Darkfish Rdoc Generator 1.1.6.