commit aedb9ca132e417bef57ee1323958bef93f3d3a3a
parent 9a7ec8af4391a5d05ba9b7195d67ab2d7d11b28a
Author: Felicitus <felicitus@felicitus.org>
Date: Sun, 30 Aug 2015 16:25:03 +0200
Use the record itself as value and not the ID
Diffstat:
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/ExtJS/Enhancements/Ext.ux.TreePicker-setValueWithObject.js b/src/PartKeepr/FrontendBundle/Resources/public/js/ExtJS/Enhancements/Ext.ux.TreePicker-setValueWithObject.js
@@ -69,5 +69,16 @@ Ext.define("PartKeepr.ux.TreePicker", {
var path = node.getPath("@id", "|");
picker.selectPath(path, "@id", "|");
- }
+ },
+ /**
+ * Changes the selection to a given record and closes the picker
+ * @private
+ * @param {Ext.data.Model} record
+ */
+ selectItem: function(record) {
+ var me = this;
+ me.setValue(record);
+ me.fireEvent('select', me, record);
+ me.collapse();
+ },
});
\ No newline at end of file