partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 90daf32bf9a73d0a384b0139609b141a0e8ff519
parent d07294558e040bb2e1af1c1e4bc46676ae170dbd
Author: Felicitus <felicitus@felicitus.org>
Date:   Thu,  3 Sep 2015 20:43:48 +0200

Added support for returning the selected object within a combobox and not their ID value

Diffstat:
Asrc/PartKeepr/FrontendBundle/Resources/public/js/ExtJS/Enhancements/Ext.form.field.ComboBox-associationSupport.js | 18++++++++++++++++++
Msrc/PartKeepr/FrontendBundle/Resources/views/index.html.twig | 3+++
2 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/ExtJS/Enhancements/Ext.form.field.ComboBox-associationSupport.js b/src/PartKeepr/FrontendBundle/Resources/public/js/ExtJS/Enhancements/Ext.form.field.ComboBox-associationSupport.js @@ -0,0 +1,17 @@ +/** + * Overrides the ExtJS Combobox with a configuration option to return the selected object and not their ID value + */ +Ext.define('Ext.form.field.ComboBox', { + override: 'Ext.form.field.ComboBox', + + config: { + returnObject: false + }, + getValue: function () { + if (this.getReturnObject() == true) { + return this.getSelection(); + } else { + return this.callParent(arguments); + } + } +});+ \ No newline at end of file diff --git a/src/PartKeepr/FrontendBundle/Resources/views/index.html.twig b/src/PartKeepr/FrontendBundle/Resources/views/index.html.twig @@ -59,6 +59,9 @@ '@PartKeeprFrontendBundle/Resources/public/js/Ext.ux/ClearableComboBox.js' '@PartKeeprFrontendBundle/Resources/public/js/Util/ServiceCall.js' '@PartKeeprFrontendBundle/Resources/public/js/org.jerrymouse.util.locale/locale.js' + '@PartKeeprFrontendBundle/Resources/public/js/ExtJS/Enhancements/Ext.grid.plugin.CellEditing-associationSupport.js' + '@PartKeeprFrontendBundle/Resources/public/js/ExtJS/Enhancements/Ext.grid.plugin.Editing-associationSupport.js' + '@PartKeeprFrontendBundle/Resources/public/js/ExtJS/Enhancements/Ext.form.field.ComboBox-associationSupport.js' '@PartKeeprFrontendBundle/Resources/public/js/Data/HydraException.js' '@PartKeeprFrontendBundle/Resources/public/js/Dialogs/ExceptionWindow.js' '@PartKeeprFrontendBundle/Resources/public/js/Dialogs/FileUploadDialog.js'