Adding color picker for bikes view/forms

This commit is contained in:
Jason Denney
2013-05-26 13:31:52 -04:00
parent 8c864e2006
commit c7974c52e8
2 changed files with 361 additions and 1 deletions
+20 -1
View File
@@ -16,7 +16,9 @@ class Bikes < Netzke::Basepack::Grid
end
}
},
:color,
#needs to have type :action or else won't work in grid, because... netzke
{ :name => "color", :type => :action, :editor => { :xtype => "xcolorcombo"}},
#{ :name => :color },
{ :name => :bike_style__style, :text => 'Style' },
{ :name => :seat_tube_height, :text => 'Seat Tube (in)'},
{ :name => :top_tube_length, :text => 'Top Tube (in)'},
@@ -32,6 +34,23 @@ class Bikes < Netzke::Basepack::Grid
]
end
def default_fields_for_forms
[
{ :name => :shop_id, :field_label => 'Shop ID'},
:serial_number,
{ :name => :bike_brand__brand, :field_label => 'Brand' },
{ :name => :bike_model__model, :field_label => 'Model'},
{ :name => "color", :xtype => "xcolorcombo"},
{ :name => :bike_style__style, :field_label => 'Style' },
{ :name => :seat_tube_height, :field_label => 'Seat Tube (in)'},
{ :name => :top_tube_length, :field_label => 'Top Tube (in)'},
{ :name => :wheel_size, :field_label => 'Wheel Size (in)'},
:value,
{ :name => :bike_condition__condition, :field_label => 'Condition'},
{ :name => :bike_status__status, :field_label => 'Status'}
]
end
#override with nil to remove actions
def default_bbar
[ :apply, :add_in_form, :search ]