class Netzke::Workspace::TabPanel

A component that allows for dynamical loading/unloading of other Netzke components in tabs.

Call the loadTab method on the client to dynamically load a component:

workspaceTabPanel.loadTab("UserGrid", {newTab: true})

Client-side methods:

+loadTab(componentClassName, options)+ - loads a component in a (new or currently active) tab

* +options+ is an object that may contain the following keys:
    * +newTab+ (boolean) - whether to load a component in a newly created tab
    * +clientConfig+ (object) - config for the loaded Netzke component

closeAllTabs - closes all open tabs

Security

By default, this component allows loading any Netzke component as requested from the client (component class has been sent as a paremeter for the deliver_component endpoint), which may not be secury enough for you. Override the :tab component to do any proper checks (see an example in the specs app).

Public Instance Methods

configure(c) click to toggle source
Calls superclass method
# File lib/netzke/workspace/tab_panel.rb, line 34
def configure(c)
  c.tabs = state[:tabs].presence
  super
end
update_tab_session_config(c) click to toggle source
# File lib/netzke/workspace/tab_panel.rb, line 49
def update_tab_session_config(c)
  tabs = state[:tabs] ||= {}
  if tab_index = c.delete(:tabIndex)
    tabs[tab_index] = c
  end
end