dispatch mouseup to dgDataControlOfIndex error
Posted: Tue Dec 31, 2013 12:29 am
I want to be able to simulate clicking on a row of a datagrid that is not displayed by dispatching "mouseUP"
If I try to dispatch a mouseup to a dataGrid row that is not displayed with the following line
I get the following error. "Type Chunk: error in object expression"
I think the error is due to the fact that the control is not drawn yet.
The error does not happen if the row is displayed.
I tried setting the 'cache controls' of the dataGrid to true and that avoids the error.
I was wondering if there was another way to avoid error by scrolling to the index first. I tried the following code which is based on code in a livecode lesson:http://lessons.runrev.com/s/lessons/m/d ... -grid-form
This will only scroll to displayed controls unless 'cache controls' are set to true.
I read setting cache controls to true can cause poor performance of the dataGrid.
Is there a way to access indexes of the dataGrid that are not displayed without using cache controls?
Thanks.
Martin
If I try to dispatch a mouseup to a dataGrid row that is not displayed with the following line
Code: Select all
dispatch "mouseup" to the dgDataControlOfIndex[ProjectsIndex] of group "projects"
I think the error is due to the fact that the control is not drawn yet.
The error does not happen if the row is displayed.
I tried setting the 'cache controls' of the dataGrid to true and that avoids the error.
I was wondering if there was another way to avoid error by scrolling to the index first. I tried the following code which is based on code in a livecode lesson:http://lessons.runrev.com/s/lessons/m/d ... -grid-form
Code: Select all
on scrollToDgRow theIndex
put the dgRectOfIndex[theIndex] of group "projects" into theControlRect
put the rect of group "Projects" into theGridRect
put item 2 of theGridRect - item 2 of theControlRect into theOffset
set the dgVScroll of group "Projects" to the dgVScroll of group "Projects" - theOffset
end scrollToDgRow
I read setting cache controls to true can cause poor performance of the dataGrid.
Is there a way to access indexes of the dataGrid that are not displayed without using cache controls?
Thanks.
Martin