Hy!
First of all, THANKS for this great work!
Then, I have made a little modify to your code because I need to work with a newSelect and only on procedure call I can insert the correct list. If I have (like in my case) a DB with the options for the select, how can I insert dynamically? I answer myself making the “list” parameter NOT a list written directly on the call, but I use an array with the same structure (key, text, value, isCategory) created from a procedure that reads a DB table.
local arrayList1 = {} for ii=1, table.maxn(PageArray.MenuChoices) do arrayList1[ii]= {} arrayList1[ii].key = ii arrayList1[ii].text = PageArray.MenuChoices[ii].caption arrayList1[ii].value = PageArray.MenuChoices[ii].caption arrayList1[ii].isCategory = false arrayList1[ii].backgroundColor = {1,1,1,1} end
On a generic call I use something like:
mui.newSelect({ name = "combo2\_List", labelText = "label1", ... list = -- if 'key' use it for 'id' in the table row arrayList1 , })
After this call, I have to read the correct values that I pass, so I modify mui-select.lua on “function M.newSelect(options)” line 178 :
muiData.widgetDict[options.name].list = {} muiData.widgetDict[options.name].list = options.list
The last modify is when you open the tableview for the selection on “function M.revealTableViewForSelector(name, options)” line 240
list = muiData.widgetDict[options.name].list
I hope to be useful to otherelse.
Thanks again.
Albert