Page 1 of 1

Data Grid position problem

Posted: Thu Jan 02, 2014 9:02 am
by Neurox66
Hi,
I've a problem with a Data Grid on iOS.
I've created a Data Grid using Data Grid Helper using the iOS script "iOS scroller script & Native fields".
In the Data Grid there are a list of items, when you select a row appear a Card with corresponding description.
The problem is: when I return to the Data Grid, the pointer return to the first item in the list and not the one that was selected.
I tried to modify the script like this:

Code: Select all

on OpenControl
if (_DGHiOS_CheckForMobileEnv()) then
## Define an iOS scroller object
set the DGHiOS_ScrollerID of me to empty
set the layerMode of grp "dgListMask" of me to "scrolling"
DGHiOS_DefineScroller
_DGHiOS_DefineFieldEditor
//start My addition
// gRiga is global variable with the index of selected row
//gScroll is global variable with the vscroll value of selected row
if gRiga > 0 then
      put the dgHilitedLines of group "DataGrid" to gRiga
      iphoneControlSet the DGHiOS_ScrollerID of me, "vscroll", gScroll    
   end if
//end My addition
end if
end OpenControl
But the result does not change.
Any advice?

Thank,
Paolo

Re: Data Grid position problem

Posted: Thu Jan 02, 2014 5:19 pm
by Klaus
Ciao Paolo,

hm, if gScroll is set correctly this should work!
But there is a typo in the script:
...

Code: Select all

if gRiga > 0 then
      ## put the dgHilitedLines of group "DataGrid" to gRiga
      SET the dgHilitedLines of group "DataGrid" to gRiga
      iphoneControlSet the DGHiOS_ScrollerID of me, "vscroll", gScroll    
   end if
...
Best

Klaus

Re: Data Grid position problem

Posted: Fri Jan 03, 2014 8:05 am
by Neurox66
Ciao Klaus,

Thank you again for your help :D

I went ahead a day trying to understand why it did not work :cry:
LiveCode is an excellent programming language :D ,
lately the only problems that I've come across are due to my typing errors :cry:

Have a nice day,
Paolo