A two-panel accordion, where panels, at the moment of being expanded, dynamically load two differently configured GridPanels.
Code:
netzke :two_grid_panels, :class_name => "AccordionPanel", :items => [{ :class_name => "GridPanel", :model => "Boss", :name => "bosses" }, { :class_name => "GridPanel", :model => "Clerk", :name => "clerks" }], :ext_config => { :width => 700, :title => "Two GridPanels loaded dynamically" }
Result:
A two-panel accordion nesting a GridPanel and a FormPanel, which get loaded along with the accordion (no dynamic loading takes place)
Code:netzke :accordion_panel, :items => [{ :class_name => "GridPanel", :model => "Boss", :name => "bosses", :preloaded => true }, { :class_name => "FormPanel", :model => "Clerk", :name => "clerks", :preloaded => true, :record_id => Clerk.first.id }], :ext_config => { :width => 700, :title => "GridPanel and FormPanel - preloaded", :border => true }
The accordion gets loaded with the first panel being "active", i.e. pre-loaded and open. The second panel is a BorderLayoutPanel with two panels - a grid and a form
Code:
netzke :border_layout_panel_active, :class_name => "AccordionPanel", :items => [{ :class_name => "Panel", :ext_config => { :html => "The first panel is active" }, :active => true },{ :class_name => "BorderLayoutPanel", :regions => { :center => { :class_name => "GridPanel", :model => "Boss" }, :south => { :class_name => "FormPanel", :model => "Clerk", :record_id => Clerk.first.id, :region_config => { :height => 150 } } } }], :ext_config => { :width => 700, :border => true }
Result: