Is it possible to set different select2 parameters at different times?
- by ReiMasuro
From playing around I can see that this code
$("#Selected3").select2({ minimumInputLength: 3 });
$("#Selected3").select2({ placeholder: "Show a placeholder" });
will show me the placeholder but remove the minimumInputLength parameters value.
Does anyone know a way please that this example could be modified so that the placeholder will be added without losing the minimum..Length value.
Any answers will need to allow for the possibility of the statements being in separate files, i.e. one on the page and another in a referenced .js file.
I am aware that this would be much easier if I set all the parameters at once, e.g.
$("#Selected3").select2({
minimumInputLength: 3,
placeholder: "Show a placeholder"
});
but I am working within a framework which won't currently allow that.
EDIT: For anyone who is willing to give this a shot but doesn't know select2 the library comes from here Select2 on GitHub