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!
In the attached stack Inserting the data into the dg works fine. Selecting the checkboxes and putting their hilite values into variable works also fine. But I'm not able to view the selected lines (click on the 'View Selections' button in the attached stack).
I'm using this code for the 'View Selections' button:
(gAllLines and gMySelection variables are created by the code in the Insert Data' button)
global gAllLines,gMySelection,gMySelectedLineNrs
on mouseUp
put empty into gMySelectedLineNrs
set the itemDelimiter to tab
local DataArray
put "0" into Counter
repeat for each line i in gMySelection
if item 2 of i is true then
put item 1 of i & tab after gMySelectedLineNrs
add 1 to Counter
end if
end repeat
set the dgData of group "DataGrid 1" to empty
put "0" into Counter
repeat for each line i in gAllLines
if item 1 of i is among the items of gMySelectedLineNrs then
put item 1 of i into DataArray[Counter]["Num"]
put item 2 of i into DataArray[Counter]["BtnCheck"]
put item 3 of i into DataArray[Counter]["Cat"]
put item 4 of i into DataArray[Counter]["Label"]
add 1 to Counter
end if
end repeat
lock screen
set the dgData of group "DataGrid 1" to DataArray
send "RefreshList" to grp "DataGrid 1" --update changes
end mouseUp
Also I had to change this line: put item 2 of i into DataArray[Counter]["BtnCheck"]
to this: put true into DataArray[Counter]["BtnCheck"]
so that the hilites of all the checkboxes stay there.
But now when I view the selected lines and click on the 'Wrap' button then the 1st line disappears (???), only the checkbox is visible (see the attached, corrected stack).
keram wrote:But now when I view the selected lines and click on the 'Wrap' button then the 1st line disappears (???), only the checkbox is visible (see the attached, corrected stack).
I do not see this here!?
All lines visible with text!
But LC complained about a stack already being in memory, even after I restarted LC!?
set the dgData of group "DataGrid 1" to empty
put 1 into Counter -- the error was here
repeat for each line i in gAllLines
if item 1 of i is among the items of gMySelectedLineNrs then
put item 1 of i into DataArray[Counter]["Num"]
put true into DataArray[Counter]["BtnCheck"]
put item 3 of i into DataArray[Counter]["Cat"]
put item 4 of i into DataArray[Counter]["Label"]
add 1 to Counter
end if
end repeat
Best,
TheSlug
http://www.aslugontheroad.com - Tutorials, demo stacks and plugins for LiveCode Data Grid Helper - An intuitive interface for building LiveCode's Data Grids Excel Library- Extends the LiveCode language for controlling MS Excel
Yes, you are here, fortunately , and you are an expert in dg (!) because only and expert could have created Data Grid Helper. Some time when I get the LC Commercial version I'll get it.
keram
Using the latest stable version of LC Community 6.7.x on Win 7 Home Premium, 64bit
and you are an expert in dg (!) because only and expert could have created Data Grid Helper
Okay, I have probably to assume to be close of this "dg expert state", but most of all I'm always happy to help with datagrids when I can.
Some time when I get the LC Commercial version I'll get it.
I have the plan to have a DGH version available for the community edition for the middle of this year, but I've not started to work on it. Fighting against MS Excel is actually taking all my free LiveCode time.
Best,
TheSlug
http://www.aslugontheroad.com - Tutorials, demo stacks and plugins for LiveCode Data Grid Helper - An intuitive interface for building LiveCode's Data Grids Excel Library- Extends the LiveCode language for controlling MS Excel