Page 1 of 1

selecting line from Datagrid - scrollbar interferes

Posted: Tue Aug 28, 2012 5:51 am
by cusingerBUSCw5N
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...

Re: selecting line from Datagrid - scrollbar interferes

Posted: Tue Aug 28, 2012 7:37 am
by slowdash
are you using a form or table?

Re: selecting line from Datagrid - scrollbar interferes

Posted: Tue Aug 28, 2012 2:11 pm
by dunbarx
Hi.

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

Craig Newman

Re: selecting line from Datagrid - scrollbar interferes

Posted: Tue Aug 28, 2012 2:23 pm
by Klaus
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

Re: selecting line from Datagrid - scrollbar interferes

Posted: Tue Aug 28, 2012 4:36 pm
by cusingerBUSCw5N
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

Re: selecting line from Datagrid - scrollbar interferes

Posted: Tue Aug 28, 2012 4:41 pm
by Klaus
YO! :D