From 9347a79e25898f9ece277ff2037a8fa140d0c874 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sat, 21 Jun 2014 23:47:08 +0200 Subject: [PATCH] Improved api to support non models (just array of objects) to show. --- .../_application_controller_table.js.coffee | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/assets/javascripts/app/controllers/_application_controller_table.js.coffee b/app/assets/javascripts/app/controllers/_application_controller_table.js.coffee index af3ad74af..76b0f939a 100644 --- a/app/assets/javascripts/app/controllers/_application_controller_table.js.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller_table.js.coffee @@ -48,6 +48,7 @@ class App.ControllerTable extends App.Controller value new App.ControllerTable( + el: element overview: ['host', 'user', 'adapter', 'active'] model: App.Channel objects: data @@ -76,9 +77,26 @@ class App.ControllerTable extends App.Controller callbackAttributes ] ) + + new App.ControllerTable( + el: element + overview: ['time', 'area', 'level', 'browser', 'location', 'data'] + attributes: [ + { name: 'time', display: 'Time', type: 'time' }, + { name: 'area', display: 'Area', type: 'text' }, + { name: 'level', display: 'Level', type: 'text' }, + { name: 'browser', display: 'Browser', type: 'text' }, + { name: 'location', display: 'Location', type: 'text' }, + { name: 'data', display: 'Data', type: 'text' }, + ] + objects: data + ) + ### tableGen: (data) -> + if !data.model + data.model = {} overview = data.overview || data.model.configure_overview || [] attributes = data.attributes || data.model.configure_attributes || {} destroy = data.model.configure_delete