Sha256: 43b902564062e145d571a92de5b62c033c405eaedd59410acf42d1c90563fde0

Contents?: true

Size: 570 Bytes

Versions: 5

Compression:

Stored size: 570 Bytes

Contents

class BookGrid < Netzke::Basepack::Grid
  def configure(c)
    c.model = "Book"
    c.title = I18n.t('books', :default => "Books")

    super
  end

  column :author__name do |c|
    c.sorting_scope = :sorted_by_author_name
  end

  # crafting a static combobox column; TODO: include a prebuilt one in Basepack
  column :rating do |c|
    c.editor = {
      :trigger_action => :all,
      :xtype => :combo,
      :store => [[0, "---"], [1, "Good"], [2, "Average"], [3, "Poor"]]
    }

    c.renderer = "function(v){return ['', 'Good', 'Average', 'Poor'][v];}"
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
netzke-basepack-0.8.4 test/basepack_test_app/app/components/book_grid.rb
netzke-basepack-0.8.3 test/basepack_test_app/app/components/book_grid.rb
netzke-basepack-0.8.2 test/basepack_test_app/app/components/book_grid.rb
netzke-basepack-0.8.1 test/basepack_test_app/app/components/book_grid.rb
netzke-basepack-0.8.0 test/basepack_test_app/app/components/book_grid.rb