View Single Post
02/14/21, 06:31 AM   #8
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
That answer in that other thread was regarding adding and removing new controls to the menu. As long as you just want to update the existing controls, that's supported.
You simply have to tell LAM that you have changed something in the data table, otherwise it wouldn't know that the dropdown choices are now different:
Lua Code:
  1. -- make sure you can access the dropdown via a variable name:
  2. local optionsData = {
  3.  --snip--
  4.     reference = "myDropdown"
  5.   },
  6. }
  7.  
  8. -- either change the optionsData table
  9. optionsData[1].choices = newChoices
  10. myDropdown:UpdateChoices()
  11.  
  12. -- or set values independently of what is stored in the optionsData. That way you can go back to the original values later
  13. myDropdown:UpdateChoices(newChoices)
  Reply With Quote