Datagrid: empty Option Menu

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Zax
Posts: 519
Joined: Mon May 28, 2007 10:12 am
Contact:

Datagrid: empty Option Menu

Post by Zax » Wed Nov 06, 2019 10:40 am

Hello,

I'm trying to use an Option Menu in a Datagrid cell.
Populating is OK, changing cell value with Option Menu is OK... All is OK but the Menu always seems empty, even if the Datagrid's data is correct and it's menuHistory is correct.
grid.jpg
grid2.jpg
grid2.jpg (20.24 KiB) Viewed 2206 times
At this time, Option menu text is "a b c" for testing purpose.
Script:

Code: Select all

on FillInData pData
   lock messages // don't send "menuPick" msg
   set the menuHistory of button 1 of me to (lineOffset(pData, the text of button 1 of me)) 
   -- set the label of button 1 of me to pData
   unlock messages
end FillInData

on menuPick pItem
   SetDataOfIndex the dgIndex of me, the dgColumn of me, pItem
end menuPick
Project browser:
Capture d’écran 2019-11-06 à 10.39.38.jpg
Checkbox behavior at column 3 works fine.
Maybe I made stupid mistake but I don't understand why the Option Menu looks empty.

Thank you.

bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Datagrid: empty Option Menu

Post by bogs » Wed Nov 06, 2019 11:00 am

If I had to guess (and that is exactly what I am doing here), then I would say it is because the grid isn't displaying the label of the option menu. I am sure there must be a way to do that, but someone else will chime in I'm sure to correct me if I'm wrong.
Image

Zax
Posts: 519
Joined: Mon May 28, 2007 10:12 am
Contact:

Re: Datagrid: empty Option Menu

Post by Zax » Wed Nov 06, 2019 11:28 am

bogs wrote:
Wed Nov 06, 2019 11:00 am
I would say it is because the grid isn't displaying the label of the option menu.
Great :)
I had to check "show name" in the Option Menu.
It works, thanks!

Post Reply