Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic LinkTables links going out of tables view. (Read 3130 times)
Mrini
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 34
Joined: Aug 18th, 2009
LinkTables links going out of tables view.
Aug 25th, 2009 at 1:30pm
Print Post  
Hi Stoyan,

Is there any way to hide LinkTables links if the rows to which it is connected goes out of view when scrolled.

Right now if I scrolled the target table and the row to which the source row is pointing goes out of table's view , the links gets displayed out of table area.


Thanks.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: LinkTables links going out of tables view.
Reply #1 - Aug 25th, 2009 at 2:46pm
Print Post  
Hi,

After scrolling you might loop over the rows and hide their links if they are not visible, by calling link.setVisible(false). Visible rows are ones whose index is >= table.getCurrentRow() and <= table.getCurrentRow() + (table.getBounds().height - table.getCaptionHeight()) / table.getRowHeight().

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Mrini
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 34
Joined: Aug 18th, 2009
Re: LinkTables links going out of tables view.
Reply #2 - Aug 26th, 2009 at 10:30am
Print Post  
Hi Stoyan,
Thanks for the reply , its working.
  
Back to top
 
IP Logged
 
Mrini
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 34
Joined: Aug 18th, 2009
Re: LinkTables links going out of tables view.
Reply #3 - Aug 27th, 2009 at 12:00pm
Print Post  
Hi Stoyan,

This approach is working only for the rows whose indexes are less than current row as in my table each row is having different row height base on the text length. so
index >= table.getCurrentRow() and <= table.getCurrentRow() + (table.getBounds().height - table.getCaptionHeight()) / table.getRowHeight()

doesn't work Sad.
Can you guide me please.

Thanks.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: LinkTables links going out of tables view.
Reply #4 - Aug 27th, 2009 at 3:23pm
Print Post  
Hi,

Then you might find the last visible row by starting a loop from the current row and summing the row heights until the sum gets larger than the table's height. Should look something like this:

Code
Select All
int lastVisible = table.getCurrentRow();
float sum = table.getCaptionHeight();
while (sum < table.getBounds.getHeight())
{
	sum += table.getRows().get(lastVisible).getHeight();
	lastVisible++;
}
 



I haven't tested this; you might need to add +/- 1 to the result.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: LinkTables links going out of tables view.
Reply #5 - Aug 27th, 2009 at 3:24pm
Print Post  
...additionally, you must add a check if the loop has reached the last row in the table and stop it in such case.
  
Back to top
 
IP Logged
 
Mrini
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 34
Joined: Aug 18th, 2009
Re: LinkTables links going out of tables view.
Reply #6 - Aug 31st, 2009 at 6:57am
Print Post  
Thanks Stoyan ,
Smiley its working.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint