View Single Post
10-14-21, 07:04 PM   #4
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
Originally Posted by Khazak View Post
Right, I got that and think I'm doing that.
Not really.

Your code is trying to ADDON.SpellRow:CreateRow(..) for every entry in your source table. When you switch to a different source table you ADDON.SpellRow:CreateRow(..) for any entries over and above the number in the previous table. It also creates a new row[1] each time even if it already exists which I suspect is causing the overlap.

In reality, when you create the list, you decide the max. no. of rows you want to see on-screen and create that many only. If you have 3 tables wih 20, 50 and 100 entries but you only want to see 10 rows at a time, create 10 rows.

You will just keep re-using those exact same row buttons no matter which table is selected or how many entries they might have. The OnVerticalScroll script tells your code which offset (entry number in the source table) to start filling your 10 rows with every time the user scrolls.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 10-14-21 at 08:48 PM.
  Reply With Quote