Improved api to support non models (just array of objects) to show.
This commit is contained in:
parent
2ac3d41fe5
commit
9347a79e25
1 changed files with 18 additions and 0 deletions
|
@ -48,6 +48,7 @@ class App.ControllerTable extends App.Controller
|
||||||
value
|
value
|
||||||
|
|
||||||
new App.ControllerTable(
|
new App.ControllerTable(
|
||||||
|
el: element
|
||||||
overview: ['host', 'user', 'adapter', 'active']
|
overview: ['host', 'user', 'adapter', 'active']
|
||||||
model: App.Channel
|
model: App.Channel
|
||||||
objects: data
|
objects: data
|
||||||
|
@ -76,9 +77,26 @@ class App.ControllerTable extends App.Controller
|
||||||
callbackAttributes
|
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) ->
|
tableGen: (data) ->
|
||||||
|
if !data.model
|
||||||
|
data.model = {}
|
||||||
overview = data.overview || data.model.configure_overview || []
|
overview = data.overview || data.model.configure_overview || []
|
||||||
attributes = data.attributes || data.model.configure_attributes || {}
|
attributes = data.attributes || data.model.configure_attributes || {}
|
||||||
destroy = data.model.configure_delete
|
destroy = data.model.configure_delete
|
||||||
|
|
Loading…
Reference in a new issue