#756 ✓invalid
dsc68

<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

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.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Pages