Improved GenericIndex widget.

This commit is contained in:
Martin Edenhofer 2013-10-18 08:26:33 +02:00
parent 97f8425c37
commit 904e5c4c7a

View file

@ -112,7 +112,8 @@ class App.ControllerGenericIndex extends App.Controller
@navupdate @pageData.navupdate
# bind render after a change is done
@subscribeId = App[ @genericObject ].subscribe(@render)
if !@disableRender
@subscribeId = App[ @genericObject ].subscribe(@render)
App[ @genericObject ].bind 'ajaxError', (rec, msg) =>
@log 'error', 'ajax', msg.status
@ -126,10 +127,12 @@ class App.ControllerGenericIndex extends App.Controller
@render()
# fetch all
App[ @genericObject ].fetch()
if !@disableInitFetch
App[ @genericObject ].fetch()
release: =>
App[ @genericObject ].unsubscribe(@subscribeId)
if @subscribeId
App[ @genericObject ].unsubscribe(@subscribeId)
render: =>