Auto-fill additional values from select2 on row create
Auto-fill additional values from select2 on row create
Hi,
I'm getting detailed information about a product through select2 ajax call (like product package, minPrice, maxQty)
Is there any way fill some of these values directly when creating new record, beside ID - this way I won't be forced to make another DB call to get these values again.
Thank's a lot.
This discussion has been closed.
Answers
So basically you are looking to copy the information from one table to another rather than using a left join - is that correct?
One option might be to use
dependent()(or just a regularchangeevent on the Select2 element) - when the value changes you could use thefield().val()method to update the values of the other fields based on the item selected?Allan
Thank's Allan for the suggestions/direction,
Finally figured out...
Basically, I'm autofilling the Create fields with Select2 response values, like this:
editor.set({field1: e.params.args.data.selectField1,field2: e.params.args.data.selectField2});Thank's again.