Data Grid position problem

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Neurox66
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 120
Joined: Tue May 22, 2012 1:57 pm
Contact:

Data Grid position problem

Post by Neurox66 » Thu Jan 02, 2014 9:02 am

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
Paolo Borzini | paolo@borzini.it
The WhiteFly Software | www.thewhitefly.it
Service on line for printers | www.4pellicole.it

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Data Grid position problem

Post by Klaus » Thu Jan 02, 2014 5:19 pm

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

Neurox66
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 120
Joined: Tue May 22, 2012 1:57 pm
Contact:

Re: Data Grid position problem

Post by Neurox66 » Fri Jan 03, 2014 8:05 am

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
Paolo Borzini | paolo@borzini.it
The WhiteFly Software | www.thewhitefly.it
Service on line for printers | www.4pellicole.it

Post Reply