tags
end
+ def query_available_inline_columns_options(query)
+ (query.available_inline_columns - query.columns).reject(&:frozen?).collect {|column| [column.caption, column.name]}
+ end
+
+ def query_selected_inline_columns_options(query)
+ (query.inline_columns & query.available_inline_columns).reject(&:frozen?).collect {|column| [column.caption, column.name]}
+ end
+
def column_header(column)
column.sortable ? sort_header_tag(column.name.to_s, :caption => column.caption,
:default_order => column.default_order) :
<%= label_tag "available_columns", l(:description_available_columns) %>
<br />
<%= select_tag 'available_columns',
- options_for_select((query.available_inline_columns - query.columns).reject(&:frozen?).collect {|column| [column.caption, column.name]}),
+ options_for_select(query_available_inline_columns_options(query)),
:multiple => true, :size => 10, :style => "width:150px",
:ondblclick => "moveOptions(this.form.available_columns, this.form.selected_columns);" %>
</td>
<%= label_tag "selected_columns", l(:description_selected_columns) %>
<br />
<%= select_tag((defined?(tag_name) ? tag_name : 'c[]'),
- options_for_select((query.inline_columns & query.available_inline_columns).reject(&:frozen?).collect {|column| [column.caption, column.name]}),
+ options_for_select(query_selected_inline_columns_options(query)),
:id => 'selected_columns', :multiple => true, :size => 10, :style => "width:150px",
:ondblclick => "moveOptions(this.form.selected_columns, this.form.available_columns);") %>
</td>