Datagrid selectionChanged bug?

Bob Sneidar bobsneidar at iotecdigital.com
Tue Jun 5 18:27:40 EDT 2018


Hi all. 

What I once thought was an endless loop bug I have isolated now to something else. It seems that when selectionChanged for a datagrid is in the executionContexts, the dgData must not be changed. I am not sure if this causes an endless loop internally to the datagrid library or not. All I know is that I immediately CTD if I do it. 

What I want to know is if this is "unexpected behavior" or if I am just doing something stupid. I won't go too deep into the weeds on why this is an issue with me, but to give you an idea, I have a search mechanism that will populate a datagrid (say a device or devices that match my search criteria) when text is entered into a field. When the user clicks on the device, I must go back to the customer and sites and yes, the devices and reload the data for all of them. 

Everything works as it should up until I attempt to set the dgData for the device datagrid to ALL the devices for that site. Since the selectionChanged handler in the devices datagrid started the whole cascading effect, that handler is still running when the data gets swapped out. 

I suppose I can get around it by using send in time so the actual selectionChanged handler finishes before the cascade of form updates happens. But if it is a bug and shouldn't be happening, I suppose I should try to make a stack that reproduces it. (I may have already done so but I don't keep track of my own bug reports!) 

Bob S





More information about the use-livecode mailing list