dgHilitedLines of Datagrid is empty

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
synto
Posts: 30
Joined: Thu Jul 18, 2019 9:31 am
Location: Paris, Fr

dgHilitedLines of Datagrid is empty

Post by synto » Mon Aug 12, 2019 1:37 pm

Hi all,

I'm trying, in the same card, to display a datagrid, and when the user select a line, a simple form is display with a "Ok" button. This button update another card and switch to it.

Here is my mouseUp handler in the Behavior Script of the datagrid, and it's working

Code: Select all

on mouseUp pMouseBtnNum
   local theDataA

   put the dgDataOfLine[the dgLine of me] of the dgControl of me into theDataA
   put theDataA["aliment"] into field labelalimentselected
   put empty into field "vnb"
   hide group "tablo"
   show group "groupQuantite" with visual effect scroll down
   
   pass mouseUp
end mouseUp

Problem is in the Ok button script of the groupQuantite: the dgHilitedLines of my datagrid is empty, and i'm unable to retrieve the data stored in the row selected by user

Code: Select all

put the dgHilitedLines of group "tablo" into theLine
put the dgDataOfLine[theLine] of group "tablo" into theDataA
Any idea what is wrong ?

Klaus
Posts: 11062
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: dgHilitedLines of Datagrid is empty

Post by Klaus » Mon Aug 12, 2019 2:28 pm

Hi synto,

sorry, do not understand your workflow...

When does the line get hilited that is missing in your "OK" button?
How does that property "disappear" (line gets unhilited)?
Can't you set a global variable or custom property and store that number for later use?
Know what i mean?


Best

Klaus

synto
Posts: 30
Joined: Thu Jul 18, 2019 9:31 am
Location: Paris, Fr

Re: dgHilitedLines of Datagrid is empty

Post by synto » Mon Aug 12, 2019 3:12 pm

1 - Card1, user select a line on the Tablo datagrid
2 - Show the groupQuantite form with Ok button
3 - Click on Ok button
4 - Update Card2 with info of hilited line of Tablo datagrid
5 - Switch to Card2

Yes it's working with a global variable but i'm just trying to avoid the use of global
And don't understand why this dgHilitedLines property become empty between step 2 and 3

Thanks for your reply Klaus

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”