Sha256: 9890de4962107f47cb511ab0c23bbe068aaac78b8059744efa067eb9c5c56e71

Contents?: true

Size: 843 Bytes

Versions: 4

Compression:

Stored size: 843 Bytes

Contents

require 'netzke-basepack'
require 'marty/permissions'

class Marty::CmGridPanel < Netzke::Basepack::Grid
  extend ::Marty::Permissions

  has_marty_permissions read: :any

  js_configure do |c|
    # For some reason the grid update function was removed in Netzke
    # 0.10.  So, add it here.
    c.cm_update = <<-JS
    function() {
      this.store.load();
    }
    JS
  end

  def configure(c)
    super

    create = self.class.can_perform_action?(:create)
    read   = self.class.can_perform_action?(:read)
    update = self.class.can_perform_action?(:update)
    delete = self.class.can_perform_action?(:delete)

    c.prohibit_create     = !create
    c.prohibit_read       = !read
    c.prohibit_update     = !update
    c.prohibit_delete     = !delete

    c.enable_edit_inline  = update
    c.enable_edit_in_form = update
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
marty-0.5.15 app/components/marty/cm_grid_panel.rb~
marty-0.5.14 app/components/marty/cm_grid_panel.rb~
marty-0.5.13 app/components/marty/cm_grid_panel.rb~
marty-0.5.12 app/components/marty/cm_grid_panel.rb~