The following issue has been resolved. As many people have been having the same issues, I am writing a tutorial on this and a few other elements to go into DG's and will post here for comment so hopefully there will be a one-stop place for all this.
XdM
Hi Brainstrust.
I must be missing something again. I have searched the forum and it seems like I am not the only one who has had this trouble, so I don't feel too bad tonight!
I am writing a stack for some building data for energy efficiency ratings. At the start, users will enter data about the construction of rooms (wall, floor, roof) into a datagrid and then on each subsequent card selected parts of that data will be recalled, and entered into datagrids on each card. So, when doing stuff with walls, the room name and wall data will appear, but not floor and roof data. That data will then be used to determine how much insulation etc is required based on Construction Code regulations.
So far, functionality is running very well. Datagrids being populated with correct data, compared to references and calculations are working perfectly.
Now, I am doing a section on skylights (roof windows).
I have a datagrid, and I am using it as a table (not a form). It will import the room name and room area, create a column with a checkbox to say if that room has a skylight that is "required by code", and 2 columns that will be populated with calculated data.
My problem seems to be with the checkbox column, as others have too.
I have managed to fumble through the DG documentation and lessons, and found how to change the column template to add a checkbox. This has worked. Currently, I have only the lines with associated data (Room Name, Room Area) as shown in the image below: by using the following code in the column behaviour:
Code: Select all
on FillInData pData
set the label of button "check" of me to pData
end FillInData
If I use the following code as per the lesson on Datagrid FORMS (not the table that I am using)
Code: Select all
on FillInData pDataArray
set the label of button "Check" of me to pDataArray["label"]
set the hilited of button "Check" of me to pDataArray["checked"]
end FillInData
a) All of the lines of the column get checkboxes, and;
b) I get the following error message: Firstly... what am I doing wrong? It has to be something simple...
Secondly... when I get that sorted out, how to I code to call up whether the checkbox is ticked or not?
I'll be using code something like this:
Code: Select all
on mousedown
repeat with x = 1 to the dgnumberoflines of group "rooflightdata"
put the dgDataofline[x] of group "RoofLightData" into DataArray
if DataArray["NCC 3.8 Req"] is true then --I need to check if the hilited of button "Check" in this column is true or false--
do something
end if
end repeat
end mousedown
Thanks in advance.
XdM
Livecode Community, Windows 10.