Provides a tab-panel-based Netzke component that:
-
allows dynamic loading of arbitrary Netzke components in (new or currently active tab)
-
handles persistence of open tabs
-
provides a method that unloads all tabs at once
Add this line to your application's Gemfile:
gem 'netzke-workspace'
And then execute:
$ bundle
Or install it yourself as:
$ gem install netzke-workspace
Inherit your workspace component from Netzke::Workspace::TabPanel. Then on the client side call the loadTab
method to dynamically load components, e.g. (the HelloWorld
component is supposed to be defined elsewhere):
class MyTabPanel < Netzke::Workspace::TabPanel
action :load_component
js_configure do |c|
c.on_load_component = <<-JS
function() {
this.loadTab("HelloWorld", newTab: true});
}
JS
end
def configure(c)
super
c.bbar = [:load_component]
end
end
See spec/rails_app/app/components
for more examples.
$ rspec spec
- Fork it ( http://github.com//netzke-workspace/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request