Sha256: 85f0f79a00d24c39567ec61493a3a11d1bab1e99bcc2a94e25dd287d624f5acf
Contents?: true
Size: 1.31 KB
Versions: 25
Compression:
Stored size: 1.31 KB
Contents
module Netzke module Basepack # A panel with the 'accordion' layout. By default, lazily loads its nested components. For example: # # class MyAccordion < Netzke::Basepack::Accordion # def configure(c) # super # c.items = [{ # # just an Ext panel # :html => "I'm a simple Ext.Panel", # :title => "Panel One" # },{ # # a Netzke component # :component => :my_component, # :title => "Panel Two" # }] # end # # component :my_component # end class Accordion < Netzke::Base include WrapLazyLoaded js_configure do |c| c.layout = :accordion c.init_component = <<-JS function(params){ this.callParent(); this.items.each(function(item){ item.on('expand', function(i){ if (i && i.wrappedComponent && !i.items.first() && !i.beingLoaded) { i.beingLoaded = true; // prevent more than one request per panel in case of fast clicking this.netzkeLoadComponent(i.wrappedComponent, {container: i.id, callback: function(){i.beingLoaded = false}}); } }, this); }, this); } JS end end end end
Version data entries
25 entries across 25 versions & 1 rubygems