<table-plus> does not sort column 'this'
Reported by dsc68 | July 12th, 2010 @ 06:23 AM | in Hobo 1.3 (Rails 3)
If you create a <table-plus>
with a column of
this
, sorting does not work when you click on the
column header.
When you create a <table-plus>
with a column
this
Hobo stores the column name of the name attribute
in sort-columns
with
sort_columns['this'] ||= this.member_class.try.name_attribute
name_attribute
however returns a symbol. Later on
in <table-plus>
, it retrieves the column name
and compares it with the sort column:
col = sort_columns[scope.field_path] || scope.field_path
sort = sort_field == col && sort_direction == 'asc' ? "-#{col}" : col
This will never match because col
is a symbol and
sort_field
is a string.
The first bit of code needs to be:
sort_columns['this'] ||= this.member_class.try.name_attribute.to_s
Comments and changes to this ticket
-
Matt Jones September 14th, 2011 @ 11:01 PM
- State changed from new to open
- Milestone set to Hobo 1.3 (Rails 3)
- Milestone order changed from 197851 to 0
-
Matt Jones September 21st, 2011 @ 03:31 AM
- State changed from open to invalid
I can't reproduce this in 1.3 -
name_attribute
returns a string there.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป