Sha256: 16e01af51afd36ad04966eebf66a268580f9529a4c15851a950484c100ce0f0c

Contents?: true

Size: 899 Bytes

Versions: 13

Compression:

Stored size: 899 Bytes

Contents

class KindaComplexComponent < Netzke::Base
  # Note the use of ActiveSupport::Concern module
  module BasicStuff
    extend ActiveSupport::Concern

    included do
      action :some_action
      action :another_action

      # Calling main class' methods is simple
      js_method :on_some_action, <<-JS
        function(){ this.items.last().setTitle("Action triggered"); }
      JS

      # Another way of defining a JS method
      js_method :on_another_action do
        <<-JS
          function(){ this.items.first().setTitle("Another action triggered"); }
        JS
      end

      js_properties(
        :active_tab => 0, :bbar => [:some_action.action, :another_action.action]
      )

      # Instance method, overridden in the ExtraStuff module
      # config
    end

    def final_config
      super.merge(:items => [{:title => "Panel One"}, {:title => "Panel Two"}])
    end

  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
netzke-core-0.7.7 test/core_test_app/app/components/kinda_complex_component/basic_stuff.rb
netzke-core-0.7.6 test/core_test_app/app/components/kinda_complex_component/basic_stuff.rb
netzke-core-0.7.5 test/core_test_app/app/components/kinda_complex_component/basic_stuff.rb
netzke-core-0.7.4 test/core_test_app/app/components/kinda_complex_component/basic_stuff.rb
netzke-core-0.7.3 test/core_test_app/app/components/kinda_complex_component/basic_stuff.rb
netzke-core-0.7.2 test/core_test_app/app/components/kinda_complex_component/basic_stuff.rb
netzke-core-0.7.1 test/rails_app/app/components/kinda_complex_component/basic_stuff.rb
netzke-core-0.6.7 test/rails_app/app/components/kinda_complex_component/basic_stuff.rb
netzke-core-0.7.0 test/rails_app/app/components/kinda_complex_component/basic_stuff.rb
netzke-core-0.6.6 test/rails_app/app/components/kinda_complex_component/basic_stuff.rb
netzke-core-0.6.5 test/rails_app/app/components/kinda_complex_component/basic_stuff.rb
netzke-core-0.6.4 test/rails_app/app/components/kinda_complex_component/basic_stuff.rb
netzke-core-0.6.3 test/rails_app/app/components/kinda_complex_component/basic_stuff.rb