How to Set Value to Select2 Lookup (2023). Since phpmaker2023 uses an ajax lookup, the old code that used to set the value doesn’t work. Tried many ways and still can’t. Now solved by using Select Native.
- You may read Select2 doc on Selecting options,
- See Use lookup cache and Lookup cache enabled pages,
- Also search “updatedone” in this forum.
Excellent It really works Thank you very much
This will break the dynamic mode of select2.
Best way,
- Remove previous options with
.html('')
- Set option with value and text
- Call
ew.createSelect(options);
Be sure to add it to “Startup Script”
$('#x_MyField').html('').append('<option value="11111">text...</option>');
eval($("#el_MyTable_MyField").find("script").text())
You may want to search “updatedone” event in this forum first.
I didn’t find anything special.
Can you give an example?
A lot of the notes were lost in the Forum change.