Skip to content

Commit

Permalink
🐛 Fix key value on input widget value relations base on g3w-suite/g3w…
Browse files Browse the repository at this point in the history
  • Loading branch information
volterra79 committed Oct 11, 2024
1 parent 2eb5d8e commit 141a1fd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,13 @@ new (class extends Plugin {

// value map widget
if (relationLayer) {
//orderring by value or key depend on orderbyvalue Boolean value
//ordering by value or key depend on orderbyvalue Boolean value
const response = await promisify(relationLayer.getDataTable({ ordering: options.orderbyvalue ? options.value : options.key }));
if (response && response.features) {
options.values.push(...(response.features || []).map(feature => ({
key: feature.properties[options.key],
value: feature.properties[options.value]
key: feature.properties[options.value],
value: feature.properties[options.key],
})));

options.loading.state = 'ready';
this.fireEvent('autocomplete', { field, features: response.features })
return options.values;
Expand Down

0 comments on commit 141a1fd

Please sign in to comment.