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
Post a Comment