javascript - Select2: Emptying and loading changed array data, loads old data -


first loaded array data by:

$("#foo").select2({ data: example }); 

then changed array "example" , wanted change select by:

$("#foo").empty(); $("#foo").select2({ data: example }); 

but old select showed up. idea why?

edit: array wasnt updated caused error.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -