Improved api to support non models (just array of objects) to show.

This commit is contained in:
Martin Edenhofer 2014-06-21 23:47:08 +02:00
parent 2ac3d41fe5
commit 9347a79e25

View file

@ -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