Open Konafets opened 7 years ago
Hi,
I iterate over an array of items. Per iteration the user has a <autocomplete> field which sets the selected data to the model.
<autocomplete>
<div id="tests_container" v-for="(item, index) in items"> <autocomplete required url="{{ route('api:products:search') }}/" :classes="{input: 'form-control', list: ''}" :id="'test_' + index + '_front_wheel'" :name="'test_' + index + '_front_wheel'" :custom-params="{ type: 'wheel' }" data-test="test" anchor="title" label="title" :on-select="setFrontWheel" :min="3" :init-value="test.front.wheel.title" tabindex="5" ></autocomplete> <input type="hidden" :id="'test_' + index + '_front_wheel_id'" :name="'test_' + index + '_front_wheel_id'" v-model="test.front.wheel.id"> </div>
I like to use the hidden input to set the selected id like so:
searchFrontWheel(obj, test){ test.front.wheel.id = obj.id; }
and pass test to setFrontWheel(test) on the component. But this does not seems to work. The method is called when the component is loaded but not when I select an item. Is there a way to do this?
test
setFrontWheel(test)
Have you found a way to achieve this?
I would like to know this as well...
Hi,
I iterate over an array of items. Per iteration the user has a
<autocomplete>
field which sets the selected data to the model.I like to use the hidden input to set the selected id like so:
and pass
test
tosetFrontWheel(test)
on the component. But this does not seems to work. The method is called when the component is loaded but not when I select an item. Is there a way to do this?