Sha256: 15b96bac1d4090a3a7af7e28d6b60bd3efbbde7bfb7baf9564bc71a26518bf1c

Contents?: true

Size: 1.08 KB

Versions: 7

Compression:

Stored size: 1.08 KB

Contents

module Netzke
  # = Wrapper
  # 
  # Simple Ext.Panel with layout 'fit' that wraps up another Netzke widget. Can be useful in HTML pages where
  # a widget should be dynamically configured, to not reload the entire page after configuration (Wrapper 
  # will reload the widget automatically).
  # 
  # == Configuration
  # * <tt>:item</tt> - configuration hash for wrapped widget
  # 
  # Example:
  # 
  #   netzke :wrapper, :item => {
  #     :widget_class_name => "FormPanel",
  #     :data_class_name => "User"
  #   }
  class Wrapper < Base
    def self.js_extend_properties
      super.merge({
        :layout => 'fit',
        
        # invisible
        :header => false,
        :border => false,
        
        :init_component => <<-END_OF_JAVASCRIPT.l,
          function(){
            Ext.netzke.cache.#{short_widget_class_name}.superclass.initComponent.call(this);

            // instantiate the item
            this.instantiateChild(this.itemConfig);
          }
        END_OF_JAVASCRIPT
      })
    end

    def initial_aggregatees
      {:item => config[:item]}
    end
    
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
skozlov-netzke-basepack-0.5.0 lib/netzke/wrapper.rb
skozlov-netzke-basepack-0.5.1 lib/netzke/wrapper.rb
skozlov-netzke-basepack-0.5.2 lib/netzke/wrapper.rb
netzke-basepack-0.5.4 lib/netzke/wrapper.rb
netzke-basepack-0.5.3 lib/netzke/wrapper.rb
netzke-basepack-0.5.1 lib/netzke/wrapper.rb
netzke-basepack-0.5.2 lib/netzke/wrapper.rb