Sha256: 60af03d19a9ca6be59579796d65a144273d8bb34220659bff5d9a00647d609af

Contents?: true

Size: 1.33 KB

Versions: 10

Compression:

Stored size: 1.33 KB

Contents

module ExtDirect
  class Composite < Netzke::Base
    js_property :layout, :border
    js_property :border, true

    component :selector, :class_name => "ExtDirect::Selector" # a form that will allow us to select a user

    component :details do
      {
        :class_name => "ExtDirect::Details", # a panel that will display details for the user
        :user => component_session[:user]
      }
    end

    component :statistics do
      {
        :class_name => "ExtDirect::Statistics", # a panel that will display details for the user
        :user => component_session[:user]
      }
    end

    def configuration
      super.merge({
        :items => [:selector.component(:region => :north, :height => 100),
          :details.component(:region => :center),
          :statistics.component(:region => :east, :width => 300, :split => true)
        ]
      })
    end

    endpoint :set_user do |params|
      component_session[:user] = params
    end

    js_method :init_component, <<-JS
      function(){
        Netzke.classes.ExtDirect.Composite.superclass.initComponent.call(this);

        this.getChildComponent('selector').on('userupdate', function(user){
          this.setUser(user);
          this.getChildComponent('details').update();
          this.getChildComponent('statistics').update();
        }, this);
      }
    JS

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
netzke-core-0.7.7 test/core_test_app/app/components/ext_direct/composite.rb
netzke-core-0.7.6 test/core_test_app/app/components/ext_direct/composite.rb
netzke-core-0.7.5 test/core_test_app/app/components/ext_direct/composite.rb
netzke-core-0.7.4 test/core_test_app/app/components/ext_direct/composite.rb
netzke-core-0.7.3 test/core_test_app/app/components/ext_direct/composite.rb
netzke-core-0.7.2 test/core_test_app/app/components/ext_direct/composite.rb
netzke-core-0.7.1 test/rails_app/app/components/ext_direct/composite.rb
netzke-core-0.6.7 test/rails_app/app/components/ext_direct/composite.rb
netzke-core-0.7.0 test/rails_app/app/components/ext_direct/composite.rb
netzke-core-0.6.6 test/rails_app/app/components/ext_direct/composite.rb