Select2 not picking up value or submitting onChange
Select2 not picking up value or submitting onChange
Hey Allan, just purchased the Editor and it looks GREAT with Select2. However, the inline control is not picking up the current cell value (maybe because the cell is displaying the label?) and it doesn't submit when a new value is checked. How do I get Select2 to pickup the correct cell value and then submit on change or when a new Select2 value is selected?
{
type : 'select2',
name : 'locale',
attr : {'class' : 'form-control', 'data-name' : 'locale' },
ipOpts : options,
opts : {
minimumResultsForSearch: -1 // gets rid of the search box
}
}
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
It sounds like the values available in the select2 list might not contain the value given by
locale
. Might that be the case? Can you link to the page so I can take a look?You could try the
submitOnBlur
option ofform-options
(which can be set when you callinline()
. Or you could add achange
event handler that will call thesubmit()
method.Regards,
Allan
Okay, so ultimately, I just took charge of the controls and set things manually. The data I need to process is coming in from the server backwards from the way Editor is wanting to read it so that necessitated me setting the Select2 control manually. No biggie once I realized what was happening.
I found a little array_flip() function on Stackoverflow that solved my issue nicely.
Great - good to hear you managed to get it resolved, and thanks for posting your code!
Allan