Sha256: d2a2af2885fd373565d518cb5861443bcd721afe4c448cb4a7bb568aeaf47cc9

Contents?: true

Size: 1.27 KB

Versions: 21

Compression:

Stored size: 1.27 KB

Contents

module Lipsiadmin
  module Ext
    # 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 => bar.l("show();"), :icon => "...", :other => "..."
    #     bar.add "Edit", :handler => bar.l("Backend.app.loadHtml('/accounts/'+accounts_grid.getSelected().id+'/edit')"), :other => "..."
    #   end
    #
    class ToolBar < Component
      attr_accessor :items
      def initialize(options={}, &block)#:nodoc:
        super("Ext.Toolbar", { :items => [] }.merge(options))
        yield self if block_given?
      end
      
      # Add new items to a Ext.Toolbar
      # 
      #   # Generates: { handler: show();, text: "Add", other: "...", icon: "..." }
      #   add "Add",  :handler => bar.l("show();"), :icon => "...", :other => "..."
      # 
      def add(name, options={})
        options[:text] = name
        config[:items] << Configuration.new(options)
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
lipsiadmin-4.1.8 lib/view/helpers/ext/tool_bar.rb
lipsiadmin-3.1 lib/view/helpers/ext/tool_bar.rb
lipsiadmin-3.2 lib/view/helpers/ext/tool_bar.rb
lipsiadmin-3.3.1 lib/view/helpers/ext/tool_bar.rb
lipsiadmin-3.0 lib/view/helpers/ext/tool_bar.rb
lipsiadmin-3.3.3 lib/view/helpers/ext/tool_bar.rb
lipsiadmin-3.3.2 lib/view/helpers/ext/tool_bar.rb
lipsiadmin-3.4.0 lib/view/helpers/ext/tool_bar.rb
lipsiadmin-3.4.1 lib/view/helpers/ext/tool_bar.rb
lipsiadmin-3.4.2 lib/view/helpers/ext/tool_bar.rb
lipsiadmin-3.3 lib/view/helpers/ext/tool_bar.rb
lipsiadmin-3.3.4 lib/view/helpers/ext/tool_bar.rb
lipsiadmin-4.1.0 lib/view/helpers/ext/tool_bar.rb
lipsiadmin-4.1.1 lib/view/helpers/ext/tool_bar.rb
lipsiadmin-4.1.2 lib/view/helpers/ext/tool_bar.rb
lipsiadmin-4.0.0 lib/view/helpers/ext/tool_bar.rb
lipsiadmin-4.1.4 lib/view/helpers/ext/tool_bar.rb
lipsiadmin-4.1.5 lib/view/helpers/ext/tool_bar.rb
lipsiadmin-4.1.3 lib/view/helpers/ext/tool_bar.rb
lipsiadmin-4.1.6 lib/view/helpers/ext/tool_bar.rb