I am hoping someone has advice on this as I've tried a few ways and not got it working but am sure there must be a way.
I am making an bespoke app for our small business invoicing needs. I originally had it in Excel
The end game for the project is to export it as an app - and for the app to be able to save data as we create new invoices. To this end I've created a substack with datagrid tables in it to store the necessary data. When new invoices get made the data can be appended to these data grids and saved within the app as they're in the substack.
In the main stack then I have a data grid table called payroll - this has the main header info for the invoice (job, client, total etc) but it also has checkboxes in each row for which jobs have been paid, need to be sent a reminder, 2nd reminder, wage paid and tax/super/gst set aside
When the mainstack loads it dumps the datagrid tables from substack into global arrays and then outputs the data for the 'payroll' array into a datagrid table in the main stack for viewing by the end user
Using the tutorials on the main site I managed to get checkboxes working for 'payment', 'reminder', 'reminder2', 'wage transferred' using TRUE/FALSE data to auto-populate the hilite status of each checkbox per row for each column. It looks great!
However if the end user clicks on the checkbox and changes the state from true/false (or any of the data in the datagrid table for that matter to be honest) I'd like to write that change back into the global array and switch a flag that the data has been changed so that if the end user tries to close the app it prompts to save the changes back to the substack
I've managed to capture the 'mouseup' event for the checkbox of each column and send a 'refresh_payroll_data' message down the line which I was catching on the card level with
Code: Select all
global invoice_header_data
global invoice_job_data
global payroll_data
on refresh_payroll_data
--get the changes made to the display datagrid
answer "made it to here"
get the dgData of group "payroll_display" of this card
put it into payroll_data
set the dgData of group "payroll_data" of card 1 of stack "ivm_database" to payroll_data
end refresh_payroll_data
Can anyone offer me sagely advice or point me in the direction of the correct documentation??