Added current value to selection.

This commit is contained in:
Martin Edenhofer 2014-12-15 23:11:48 +01:00
parent 9997513671
commit 3ccff4401e

View file

@ -1595,6 +1595,16 @@ class App.ControllerForm extends App.Controller
if record['id'] is key || ( record['id'] && key && record['id'].toString() is key.toString() )
list.push record
# check if current value need to be added
if @params[ attribute.name ]
hit = false
for value in list
if value['id'].toString() is @params[ attribute.name ].toString()
hit = true
if !hit
currentRecord = App[ attribute.relation ].find( @params[ attribute.name ] )
list.push currentRecord
# no data filter matched
else
App.Log.debug 'ControllerForm', '_getRelationOptionList:filter-data no filter matched'