Hello,
In the attached stack I have text lines belonging to 3 categories that can be selected with 3 checkboxes.
After selecting the categories when you click the button 'Lines of Selected Categories' the data grid should populate with the lines in selected categories.
However it does not as it is now.
If I disable the line 'set the hilite of btn "BtnCheck" of me to pDataArray["BtnCheck"]' in the 'FillInData pDataArray' handler in the button 'Behavior Scrip' then the data grid gets populated and I get everything, but the checkboxes do not hold the hilite states, i.e when I click on 'Wrap o/x' button the selections disappear.
How to correct the code to populate the dg and have the checkboxes maintain the hilite state?
keram
populate data grid and keep the hilite state of checkboxes
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
populate data grid and keep the hilite state of checkboxes
- Attachments
-
- DG Form-categories card.zip
- (14.37 KiB) Downloaded 197 times
Using the latest stable version of LC Community 6.7.x on Win 7 Home Premium, 64bit
-
- VIP Livecode Opensource Backer
- Posts: 163
- Joined: Tue Jan 26, 2010 10:15 pm
- Contact:
Re: populate data grid and keep the hilite state of checkbox
Hi Keram,
When you are preparing the data for populating the datagrid, you are omitting the second column of your group named "data".
Your code should be:
You have to store the state of the checkboxes in the second column of your "data" group to have them revert back when you are populating the datagrid.
Best,
When you are preparing the data for populating the datagrid, you are omitting the second column of your group named "data".
Your code should be:
Code: Select all
repeat for each line i in AllLines
if item 3 of i is among items of gMyCategories then put item 1 of i &tab& item 2 of i & tab & \
item 3 of i &tab& item 4 of i &cr after LinesInMyCategories --lines in selected categories
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
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
Re: populate data grid and keep the hilite state of checkbox
Hi TheSlug,
Thanks for your help! It works OK now
(Yes, I missed that item...
)
Now I have increased the number of lines to over 600.
Is there any way to make the refreshing of the view and the toggling of the wrapping of the grid more speedy?
I'm attaching the corrected stack with 640 lines.
keram
Thanks for your help! It works OK now

(Yes, I missed that item...

Now I have increased the number of lines to over 600.
Is there any way to make the refreshing of the view and the toggling of the wrapping of the grid more speedy?
I'm attaching the corrected stack with 640 lines.
keram
- Attachments
-
- DG Form-categories card2.zip
- (20.26 KiB) Downloaded 205 times
Using the latest stable version of LC Community 6.7.x on Win 7 Home Premium, 64bit
-
- VIP Livecode Opensource Backer
- Posts: 163
- Joined: Tue Jan 26, 2010 10:15 pm
- Contact:
Re: populate data grid and keep the hilite state of checkbox
I done a quick test, and drawing the datagrid is just immediate for me.Now I have increased the number of lines to over 600.
Is there any way to make the refreshing of the view and the toggling of the wrapping of the grid more speedy?
However you can try this:
- adding a "lock screen" before to change the wrap:
Code: Select all
on mouseUp --toggle dontWrap t/f
local tNewSetting, tRowTemplateRef
lock screen
put not the dgProp["fixed row height"] of grp "DataGrid 1" into tNewSetting
set the dgProp["fixed row height"] of grp "DataGrid 1" to tNewSetting --toggle t/f fixed line height
put the dgProp["row template"] of grp "DataGrid 1" into tRowTemplateRef
set the dontWrap of fld "Label" of tRowTemplateRef to tNewSetting
set the dgVScroll of grp "DataGrid 1" to 0 --top
send "ResetList" to grp "DataGrid 1" --update changes
unlock screen
end mouseUp
http://lessons.runrev.com/s/lessons/m/d ... t-is-false
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
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
Re: populate data grid and keep the hilite state of checkbox
Thanks again TheSlug,
Great tip!
this is no-wrapping view:
this is first stage when I click on Wrap button - it's visible just for a fraction of second:
and this is when the lines are wrapping: So it's quite a difference.
keram
Great tip!
Perhaps your computer is faster. In my case there some noticeable improvement. Without the 'lock screen' it would expand in 2 steps:Zryip TheSlug wrote:and drawing the datagrid is just immediate for me
this is no-wrapping view:
this is first stage when I click on Wrap button - it's visible just for a fraction of second:
and this is when the lines are wrapping: So it's quite a difference.
keram
Using the latest stable version of LC Community 6.7.x on Win 7 Home Premium, 64bit