Sha256: f2d758124168d11d965c6300cb6637ad4ff2e86387fbe51855cc88ce85337e3d

Contents?: true

Size: 516 Bytes

Versions: 5

Compression:

Stored size: 516 Bytes

Contents

module Netzke
  class ExtComponent
    attr_accessor :name

    def initialize(name, config = {})
      @name = name
      @config = config
    end

    def config
      @config ||= {}
    end

    # Rendering
    def js_component_render
      %Q{Ext.ComponentMgr.create(#{config.to_nifty_json}).render("ext-#{name.to_s.split('_').join('-')}");}
    end

    # Container for rendering
    def js_component_html
      %Q{<div id="ext-#{name.to_s.split('_').join('-')}" class="ext-component"></div>}
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
netzke-core-0.6.7 lib/netzke/ext_component.rb
netzke-core-0.6.6 lib/netzke/ext_component.rb
netzke-core-0.6.5 lib/netzke/ext_component.rb
netzke-core-0.6.4 lib/netzke/ext_component.rb
netzke-core-0.6.3 lib/netzke/ext_component.rb