Netzke::TabPanel

Features:
  • Dynamically loads the nested widget when a tab gets activated for the first time
  • Is loaded along with the "active" widget - saves a request to the server
  • Example 1: two GridPanels, the second one loads dynamically

    A panel with 2 tabs, where the first one contains a preloaded GridPanel, and the second loads another GridPanel dynamically (at the moment of the tab being activated).

    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:

    Example 2: two GridPanels, the second one is preloaded

    Same as before, but the second panel is loaded from the beginning

    Code:

    netzke :two_preloaded_grid_panels,
              :class_name => "AccordionPanel",
              :items => [{
                :class_name => "GridPanel",
                :model => "Boss",
                :name => "bosses"
              }, {
                :class_name => "GridPanel",
                :model => "Clerk",
                :name => "clerks",
                :preloaded => true
              }], 
              :ext_config => {
                :width => 700,
                :title => "Two GridPanels loaded dynamically"
              } 
    

    Result: