WowAce.com
Home
Addons
Authors
Forums
Knowledge base
Paste
Site issues
Sign in
lib-ScrollingTable
Overview
Files
Images
Tickets
Pages
Forum
Repositories
Subscriptions
Donate
Curse
Creating a ScrollingTable
r12
Source
Markup:
*
lib-st is a factory. It creates and returns an instance of a scrolling table for you to use. To create a scrolling table <tt><pre> local ScrollingTable = LibStub("ScrollingTable"); local table = ScrollingTable:CreateST(); </pre></tt> Calling CreateST without any arguments will return a default testing table.<br/> [http://www.wowace.com/projects/lib-st/pages/create-st/ Click here] for more info on the '''CreateST''' function. After creating a scrolling table, you have to load it with data.<br/> [http://www.wowace.com/projects/lib-st/pages/set-data/ Click here] for more information on the '''SetData''' function. You can register event handlers for various frame events!<br/> [http://www.wowace.com/projects/lib-st/pages/ui-events/ Click here] for more information on the '''RegisterEvents''' function. The sorting of the table is NON-DESTRUCTIVE. This means that the order of rows will remain the same, and you can update the data table after you have set it with new information if you need to. If you update data that needs to be sorted, call the '''SortData''' function on the scrolling table. If you just want to update a color value, a simple '''Refresh''' call will do fine. <tt><pre> local ScrollingTable = LibStub("ScrollingTable"); local table = ScrollingTable:CreateST(cols); table:SetData(data); -- if data is updated table:SortData(); -- no need to call Refresh, it is called internally. -- if a color is updated table:Refresh(); -- set a row filter function table:SetFilter(fnFilter); </pre></tt> example filter function: <tt><pre> fnFunction = function(self, row) -- only show rows who's 1st column value is > 10 local show = false; if row.cols[1].value > 10 then show = true; end return show; end; </pre></tt> Assigning a filter function will resort your table. Remember, you can edit the data set you supply to the scrolling table at any time to update the display. Even removing or adding rows. It's a good idea in practice to resort the table after an edit.
Markup Type:
*
The type of markup for this entry.
Click here for details
.
WikiCreole
BBCode
Safe HTML
Plain Text
Markdown
Textile
Curse Wiki (Deprecated)