diff --git a/app/assets/javascripts/app/controllers/_application_controller_table.coffee b/app/assets/javascripts/app/controllers/_application_controller_table.coffee index b7c38d97f..784bba761 100644 --- a/app/assets/javascripts/app/controllers/_application_controller_table.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller_table.coffee @@ -66,7 +66,7 @@ class App.ControllerTable extends App.Controller overview: ['host', 'user', 'adapter', 'active'] model: App.Channel objects: data - groupBy: 'group' + groupBy: 'adapter' checkbox: false radio: false class: 'some-css-class' @@ -129,7 +129,7 @@ class App.ControllerTable extends App.Controller # remove group by attribute from header overview = _.filter( overview - (item) -> + (item) => return item if item isnt @groupBy return ) @@ -137,7 +137,7 @@ class App.ControllerTable extends App.Controller # get new order groupObjects = _.groupBy( @objects - (item) -> + (item) => return '' if !item[@groupBy] return item[@groupBy].displayName() if item[@groupBy].displayName item[@groupBy] @@ -211,13 +211,14 @@ class App.ControllerTable extends App.Controller # get content @log 'debug', 'table', 'header', headers, 'overview', 'objects', @objects table = App.view('generic/table')( - header: headers - objects: @objects - checkbox: @checkbox - radio: @radio - groupBy: @groupBy - class: @class - destroy: destroy + table_id: @table_id + header: headers + objects: @objects + checkbox: @checkbox + radio: @radio + groupBy: @groupBy + class: @class + destroy: destroy callbacks: @callbackAttributes ) @@ -371,7 +372,7 @@ class App.ControllerTable extends App.Controller { key: rightColumnKey, width: rightWidth } ] - @log 'error', @table_id, 'leftColumnKey', leftColumnKey, leftWidth, 'rightColumnKey', rightColumnKey, rightWidth + @log 'debug', @table_id, 'leftColumnKey', leftColumnKey, leftWidth, 'rightColumnKey', rightColumnKey, rightWidth @preferencesStore('headerWidth', leftColumnKey, leftWidth) @preferencesStore('headerWidth', rightColumnKey, rightWidth) @@ -400,12 +401,13 @@ class App.ControllerTable extends App.Controller if !data[type][key] data[type][key] = {} data[type][key] = value + @log 'debug', @table_id, 'preferencesStore', data localStorage.setItem(@preferencesStoreKey(), JSON.stringify(data)) preferencesGet: => - storeKey = @preferencesStoreKey() - data = localStorage.getItem(storeKey) + data = localStorage.getItem(@preferencesStoreKey()) return {} if !data + @log 'debug', @table_id, 'preferencesGet', data JSON.parse(data) preferencesStoreKey: => diff --git a/app/assets/javascripts/app/controllers/ticket_overview.coffee b/app/assets/javascripts/app/controllers/ticket_overview.coffee index 0cf8839a8..c96b097b9 100644 --- a/app/assets/javascripts/app/controllers/ticket_overview.coffee +++ b/app/assets/javascripts/app/controllers/ticket_overview.coffee @@ -281,7 +281,7 @@ class Table extends App.Controller value new App.ControllerTable( - table_id: "ticket_overview_#{@overview_id}" + table_id: "ticket_overview_#{@overview.id}" overview: @overview.view.s el: @$('.table-overview') model: App.Ticket diff --git a/app/assets/javascripts/app/views/generic/table.jst.eco b/app/assets/javascripts/app/views/generic/table.jst.eco index 5da2fab2d..2e9ec84b7 100644 --- a/app/assets/javascripts/app/views/generic/table.jst.eco +++ b/app/assets/javascripts/app/views/generic/table.jst.eco @@ -15,7 +15,7 @@ <% end %> <% for item, i in @header: %>