Skip to content

A Netzke component that loads other components in persisted tabs

License

Notifications You must be signed in to change notification settings

netzke/netzke-workspace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Netzke::Workspace

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

Installation

Add this line to your application's Gemfile:

gem 'netzke-workspace'

And then execute:

$ bundle

Or install it yourself as:

$ gem install netzke-workspace

Usage

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.

Running tests

$ rspec spec

Contributing

  1. Fork it ( http://github.com//netzke-workspace/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

A Netzke component that loads other components in persisted tabs

Resources

License

Stars

Watchers

Forks

Packages

No packages published