Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

make width of list view customizable.

  • Loading branch information...
commit cc5bf1efe63c3976a96f5c3f00b3111ec6ed2811 1 parent 9cc732c
@twinge twinge authored
View
6 README.md
@@ -228,6 +228,12 @@ You can display empty fields in show view with:
config.compact_show_view = false
end
+You can customize the width of the list view with:
+
+ RailsAdmin.config do |config|
+ config.total_columns_width = 1000
+ end
+
**Whitelist Approach**
By default, RailsAdmin automatically discovers all the models in the system and adds them to its list of models to
View
2  app/helpers/rails_admin/main_helper.rb
@@ -43,7 +43,7 @@ def calculate_width(properties)
# if properties that were gathered so far have the width
# over 697 make a set for them
- if partial_total + width >= 697
+ if partial_total + width >= RailsAdmin::Config.total_columns_width
set << {:p => temp, :size => partial_total}
partial_total = 0
temp = []
View
4 lib/rails_admin/config.rb
@@ -74,6 +74,9 @@ class << self
# hide blank fields in show view if true
attr_accessor :compact_show_view
+ # Set the max width of columns in list view before a new set is created
+ attr_accessor :total_columns_width
+
# Stores model configuration objects in a hash identified by model's class
# name.
#
@@ -257,6 +260,7 @@ def reset
@default_search_operator = 'default'
@excluded_models = []
@included_models = []
+ @total_columns_width = 697
@label_methods = [:name, :title]
@registry = {}
end
Please sign in to comment.
Something went wrong with that request. Please try again.