diff --git a/app/assets/javascripts/app/controllers/_application_controller/table.coffee b/app/assets/javascripts/app/controllers/_application_controller/table.coffee index 9ca732ac2..5ee35e98b 100644 --- a/app/assets/javascripts/app/controllers/_application_controller/table.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller/table.coffee @@ -638,6 +638,7 @@ class App.ControllerTable extends App.Controller align: 'right' parentClass: 'noTruncate no-padding' unresizable: true + unsortable: true @bindCol['action'] = events: @@ -707,7 +708,9 @@ class App.ControllerTable extends App.Controller list (item) -> res = iteratee(item) - return res if res + # Checking for a falsey value would overide 0 or false to placeholder. + # UnderscoreJS sorter breaks when \uFFFF is sorted together with non-string values. + return res if res != null and res != undefined and res != '' # null values are considered lexicographically "last" '\uFFFF' ) diff --git a/app/assets/javascripts/app/models/macro.coffee b/app/assets/javascripts/app/models/macro.coffee index aa3e4b1d7..ff3ecd180 100644 --- a/app/assets/javascripts/app/models/macro.coffee +++ b/app/assets/javascripts/app/models/macro.coffee @@ -12,7 +12,7 @@ class App.Macro extends App.Model }, { name: 'updated_at', display: 'Updated', tag: 'datetime', readonly: 1 }, { name: 'note', display: 'Note', tag: 'textarea', limit: 250, null: true }, - { name: 'group_ids', display: 'Groups', tag: 'column_select', relation: 'Group', null: true }, + { name: 'group_ids', display: 'Groups', tag: 'column_select', relation: 'Group', null: true, unsortable: true }, { name: 'active', display: 'Active', tag: 'active', default: true }, ] @configure_delete = true diff --git a/app/assets/javascripts/app/models/text_module.coffee b/app/assets/javascripts/app/models/text_module.coffee index 02e32425b..9e9f6b350 100644 --- a/app/assets/javascripts/app/models/text_module.coffee +++ b/app/assets/javascripts/app/models/text_module.coffee @@ -24,7 +24,7 @@ class App.TextModule extends App.Model } ], note: 'To select placeholders from a list, just enter "::".'}, { name: 'updated_at', display: 'Updated', tag: 'datetime', readonly: 1 }, - { name: 'group_ids', display: 'Groups', tag: 'column_select', relation: 'Group', null: true }, + { name: 'group_ids', display: 'Groups', tag: 'column_select', relation: 'Group', null: true, unsortable: true }, { name: 'active', display: 'Active', tag: 'active', default: true }, ] @configure_delete = true diff --git a/app/assets/javascripts/app/views/generic/table.jst.eco b/app/assets/javascripts/app/views/generic/table.jst.eco index 33ef145d1..6e5663bc6 100644 --- a/app/assets/javascripts/app/views/generic/table.jst.eco +++ b/app/assets/javascripts/app/views/generic/table.jst.eco @@ -20,7 +20,7 @@ <% end %> <% for header, i in @headers: %>