Sha256: 34454e5a369c8cb25ab64906bc6efa6feef5dcba2d56a670e8953c05b3495589

Contents?: true

Size: 821 Bytes

Versions: 3

Compression:

Stored size: 821 Bytes

Contents

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

    included do
      action :some_action
      action :another_action

      js_configure do |c|
        c.extend = "Ext.tab.Panel"
        c.active_tab = 0

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

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

    def configure(c)
      super
      c.bbar = [:some_action, :another_action]
      c.items = [{:title => "Panel One"}, {:title => "Panel Two"}]
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
netzke-core-0.8.4 test/core_test_app/app/components/ruby_modules/basic_stuff.rb
netzke-core-0.8.3 test/core_test_app/app/components/ruby_modules/basic_stuff.rb
netzke-core-0.8.2 test/core_test_app/app/components/ruby_modules/basic_stuff.rb