selecting line from Datagrid - scrollbar interferes

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

selecting line from Datagrid - scrollbar interferes

Post by cusingerBUSCw5N » Tue Aug 28, 2012 5:51 am

I want to select a line from a DataGrid and have it go to a url connected with that line. Everything's good - except my object script is based on OnMouseUp...so when I use the scrollbar to scroll down my DataGrid, on mouseUP, it takes the original line that the scrollbar started on and acts like it was selected. If it can't figure out what line I started with, it just opens a blank url. Needless to say, urls are opening all over the place!

How do I set it up so that it is on mouseUP in a specific column within the DataGrid?

Thanks again...

slowdash
Posts: 24
Joined: Wed Feb 22, 2012 10:52 am

Re: selecting line from Datagrid - scrollbar interferes

Post by slowdash » Tue Aug 28, 2012 7:37 am

are you using a form or table?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6518
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: selecting line from Datagrid - scrollbar interferes

Post by dunbarx » Tue Aug 28, 2012 2:11 pm

Hi.

Can't you check the target and not send your url stuff if it happens to be the scrollbar?

Craig Newman

Klaus
Posts: 11585
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: selecting line from Datagrid - scrollbar interferes

Post by Klaus » Tue Aug 28, 2012 2:23 pm

Looks like this is a special "feature" of datagrids!

If you add the "mouseup" script to the datagrid group directly
then the "mouseup" is also being triggered when you use the scrollbar,
since the scrollbar is actually a separate object in the complex datagrid "group".

Try this:

Code: Select all

...
if word 1 of the target <> "scrollbar" then
  ## do your URL stuff here
end if
...
Or use the behavior of the datagrid to handle your "mouseup" stuff, that will not affect the scrollbars!

Best

Klaus

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: selecting line from Datagrid - scrollbar interferes

Post by cusingerBUSCw5N » Tue Aug 28, 2012 4:36 pm

It is a beautiful thing! I used

if word 1 of the target <> "scrollbar" then
launch url theDataC["Link Address"]
end if

and the scrollbar is no longer my enemy

Thanks

Klaus
Posts: 11585
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: selecting line from Datagrid - scrollbar interferes

Post by Klaus » Tue Aug 28, 2012 4:41 pm

YO! :D

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”