Skip to content
Snippets Groups Projects
Commit 570202d7 authored by Bekerle, Patrizio's avatar Bekerle, Patrizio :fire: Committed by Reiter, Christoph
Browse files

Set jQuery object data

parent 6e27a481
No related branches found
No related tags found
No related merge requests found
...@@ -132,6 +132,7 @@ class PersonSelect extends VPULitElementJQuery { ...@@ -132,6 +132,7 @@ class PersonSelect extends VPULitElementJQuery {
const object = findObjectInApiResults(identifier, lastResult); const object = findObjectInApiResults(identifier, lastResult);
$this.attr("data-object", JSON.stringify(object)); $this.attr("data-object", JSON.stringify(object));
$this.data("object", object);
// fire a change event // fire a change event
that.dispatchEvent(new CustomEvent('change', { that.dispatchEvent(new CustomEvent('change', {
...@@ -160,6 +161,7 @@ class PersonSelect extends VPULitElementJQuery { ...@@ -160,6 +161,7 @@ class PersonSelect extends VPULitElementJQuery {
const identifier = person["@id"]; const identifier = person["@id"];
const option = new Option(person.name, identifier, true, true); const option = new Option(person.name, identifier, true, true);
$this.attr("data-object", JSON.stringify(person)); $this.attr("data-object", JSON.stringify(person));
$this.data("object", person);
that.$select.append(option).trigger('change'); that.$select.append(option).trigger('change');
// fire a change event // fire a change event
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment