How Do I Refresh a Data Grid After Making Changes to a Template Through Script?
The command ResetList redraws a data grid after having copied in fresh copies of any templates. Here is an example of how you might use it.
## Get reference to group that serves as row template for data grid
put the dgProps["row template"] of group "DataGrid" into theRowTemplate
## For tables get reference to custom template for column
put the long id of group "My Column" of theRowTemplate into theColTemplate
## Make any updates to template
set the text of button 1 of theColTemplate to "New Option1" & cr & "New Option 2"
## Refresh the data grid
dispatch "ResetList" to group "DataGrid"
I don't know if anyone still monitors this, but I'm having a bit of trouble with the above code. I'm trying to use it to resize a data grid when running an iOS app on the new iPad. My data grid ends up totally blank. I've verified that it is indeed populated with data. As far as I can tell all my code that handles the resizing is working correctly.
Any thoughts? Should I be doing something different to handle this sort of situation?