Sha256: badd8cae63f4da373785809d4527450ac59a73b1155a062b89a11dccfdd8c06f

Contents?: true

Size: 1.3 KB

Versions: 4

Compression:

Stored size: 1.3 KB

Contents

class Marty::PivotGrid < Netzke::Base
  include self::Endpoints
  include self::Services
  include Netzke::Basepack::Columns
  include Netzke::Basepack::DataAccessor
  include Netzke::Core::ConfigToDslDelegator

  js_configure do |c|
    c.require "/home2/abostani/pivot-grid/mzPivotGrid-all.js"

    c.extend = 'Mz.pivot.Grid'
    c.mixin :pivot_grid

    c.mixins << "Netzke.mixins.Basepack.Columns"
    c.mixins << "Netzke.mixins.Basepack.GridEventHandlers"

    c.require :extensions
  end

  css_configure do |c|
    c.require "/home2/abostani/pivot-grid/mzPivotGrid.css"
  end

  delegates_to_dsl :model

  def js_configure(c)
    super

    c.title = c.title || self.class.js_config.properties[:title] || data_class.name.pluralize
    c.context_menu = context_menu
    c.columns = {items: js_columns}
    c.columns_order = columns_order
    c.inline_data = read if c.load_inline_data
    c.pri = data_adapter.primary_key
  end

  def config
    @config ||= ActiveSupport::OrderedOptions.new.tap do |c|
      # extend with data_store convenient config object
      c.data_store = ActiveSupport::OrderedOptions.new
    end
  end

  def context_menu
    config.has_key?(:context_menu) ? config[:context_menu] : default_context_menu
  end

  # Override to change the default context menu
  def default_context_menu
    []
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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