Class: Lipsiadmin::Ext::ToolBar
- Defined in:
- lib/view/helpers/ext/tool_bar.rb
Overview
Generate a new Ext.Toolbar
Examples:
var toolBar = new Ext.Toolbar([{
handler: show,
text: "Add",
other: "...",
icon: "..."
},{
handler: Backend.app.loadHtml('/accounts/'+accounts_grid.getSelected().id+'/edit'),
text: "Edit",
other: "..."
}]);
grid.tbar do |bar|
bar.add "Add", :handler => "show".to_l, :icon => "...", :other => "..."
bar.add "Edit", :handler => "Backend.app.loadHtml('/accounts/'+accounts_grid.getSelected().id+'/edit')".to_l, :other => "..."
end
Instance Method Summary collapse
-
#add_button(options, &block) ⇒ Object
Add new items to a Ext.Toolbar.
-
#initialize(options = {}) {|_self| ... } ⇒ ToolBar
constructor
:nodoc:.
Methods inherited from Component
#add, #after, #before, #config, #config=, #get_var, #id, #method_missing, #on, #prefix=, #raise_error, #title, #to_s, #un, #var, #with_output_buffer
Constructor Details
#initialize(options = {}) {|_self| ... } ⇒ ToolBar
:nodoc:
25 26 27 28 |
# File 'lib/view/helpers/ext/tool_bar.rb', line 25 def initialize(={}, &block)#:nodoc: super("Ext.Toolbar", { :buttons => [] }.merge()) yield self if block_given? end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Lipsiadmin::Ext::Component
Instance Method Details
#add_button(options, &block) ⇒ Object
Add new items to a Ext.Toolbar
# Generates: { handler: show, text: "Add", other: "...", icon: "..." }
:text => "Add", :handler => "show".to_l, :icon => "...", :other => "..."
35 36 37 |
# File 'lib/view/helpers/ext/tool_bar.rb', line 35 def (, &block) config[:buttons] << (.is_a?(String) ? : Button.new(, &block).config) end |