Sha256: 447e7c1f6b32db708b5d38712a7ffa6d0523cc65dc43f410c739670806b4e6c4

Contents?: true

Size: 546 Bytes

Versions: 8

Compression:

Stored size: 546 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.ComponentManager.create("#{js_full_class_name}", #{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

8 entries across 8 versions & 1 rubygems

Version Path
netzke-core-0.7.7 lib/netzke/ext_component.rb
netzke-core-0.7.6 lib/netzke/ext_component.rb
netzke-core-0.7.5 lib/netzke/ext_component.rb
netzke-core-0.7.4 lib/netzke/ext_component.rb
netzke-core-0.7.3 lib/netzke/ext_component.rb
netzke-core-0.7.2 lib/netzke/ext_component.rb
netzke-core-0.7.1 lib/netzke/ext_component.rb
netzke-core-0.7.0 lib/netzke/ext_component.rb