lib-st provides a convenient way to create and display a scrolling table of data.
Supply column info and your table data, and you're off!
To get a handle in lua:
local ScrollingTable = LibStub("ScrollingTable");
To package in your addon, add to your .pkgmeta file:
externals: Libs/lib-st: url: svn://svn.wowace.com/wow/lib-st/mainline/trunk tag: latest
Leave off the tag line if you want the absolute lastest alpha version from the site. (I try to keep a stable copy tagged as latest)
New Features:
Added support for calling SetData with a minimal dataset which can drastically reduce the number of tables that exist within the mod... at a slight cost to customization.
Other recent changes
If no args or colorargs are specified for value and color functions, respectively, instead of no args, these args will be passed:
function (data, cols, realrow, column, sttable) -- sttable is a reference to the scrolling table end
Here's some nitty-gritty:
- Set names and widths of columns, lib-st will set the table width on it's own!
- Set the number of rows, and a value to use for row height, lib-st will set the table height on it's own!
- Set background colors for each column.
- Set column text alignment.
- Set column text color.
- Set row text color.
- Set text color on a cell-by-cell basis.
- Supply functions to be evaluated for cell data, and cell/row/column text colors!
- Filter table data via a filter funtion.
- Table sorts are NON-DESTRUCTIVE. Data or the order of data supplied is never changed (unless modified by user supplied functions) for the display of the table. No copies of the data are made either. 1 Table, your data, sort it, index it as it was when it was created, update it as you see fit.
- Hookable ui events. find out more here
- Custom cell formatting with a custom display function
- Enable selection on your scrolling table
Find out how to create a scrolling table using lib-st!
Let me know if you use it!!
-> Screenshots
Facts
- Date created
- 14 Oct 2008
- Categories
- Last update
- 07 Jan 2010
- Development stage
- Release
- License
- GNU General Public License version 2 (GPLv2)
- Curse link
- lib-ScrollingTable
- Reverse relationships
- 13
- Recent files
Authors
Relationships
- Embedded library
- LibStub
- #23
ddumont Sun, 20 Dec 2009 05:13:50:) Thanks!
- #22
chaosknightz Sun, 20 Dec 2009 04:47:09works great thanks for all the help, you rock!
- #21
ddumont Sat, 19 Dec 2009 21:13:38Hi. As for the ace gui frame, make sure you are getting the actual frame object. I think it's something like:
About the repetition of 1 guildy, there seems to be some problems with the way you are looping. I copied your example, and my proposed changes over here: http://paste.wowace.com/1570/
Also, please create a wowace project for your mod and have it link to me by embedding my library in your mod. I get points, and if your mod is popular, so will you!
- #20
chaosknightz Sat, 19 Dec 2009 18:33:04im having problems with two things atm. the first is trying to define a parent for the scrolling table when i have a ace gui frame mde. the other is avtually getting the data to populate correctly. the only thing i have been able to sucessfully do is get the name, rank and level of one person from the guild and their data repeated throughout the table. eveyrthing else i have tried has resulted in an error. here is the code:
local ScrollingTable = LibStub("ScrollingTable");
local cols = {
{
["name"] = "Name",
["width"] = 100,
["color"] = { ["r"] = 0.5, ["g"] = 0.5, ["b"] = 1.0, ["a"] = 1.0 },
},
{
["name"] = "Rank",
["width"] = 100,
["align"] = "CENTER",
["bgcolor"] = { ["r"] = 1.0, ["g"] = 0.0, ["b"] = 0.0, ["a"] = 0.2 },
},
{
["name"] = "Level",
["width"] = 100,
["align"] = "RIGHT",
["bgcolor"] = { ["r"] = 0.0, ["g"] = 0.0, ["b"] = 0.0, ["a"] = 0.5 },
},
};
local st = ScrollingTable:CreateST(cols);
local gdata = {}
for row = 1, GetNumGuildMembers() do
if not gdata[row] then
gdata[row] = {};
end
for col = 1, 3 do
if not gdata[row].cols then
gdata[row].cols = {};
end
for i = 1, GetNumGuildMembers() do
local name, rank, rankIndex, level, class, zone, note, officernote, online, status, classFileName = GetGuildRosterInfo(i)
gdata[row].cols[1] = { ["value"] = name };
gdata[row].cols[2] = { ["value"] = rank };
gdata[row].cols[3] = { ["value"] = level };
end
end
st:SetData(gdata);
end
end
- #19
ddumont Thu, 10 Dec 2009 12:41:44Hi!
Thanks for pointing that out. but I'd recommend using the latest tagged and stable version for testing. Right now the alphas are unstable, I'm trying to put some new support in for someone and haven't had good solid chunks of time to spend on it yet.
- #18
Corg Thu, 10 Dec 2009 05:37:13Hi DDumont,
The latest version of this library appears to have a bug. fRealRow should be renamed to isRealRow.
It's messing up the sorting in my mod and I was hoping to get my new mod approved for release this week.
Thanks!
- #17
ddumont Sat, 05 Dec 2009 19:13:57Are you going to put it on wowace? I'd like to link back to you if you decide to use my library. I'm also interested in growing my generated points/day :)
- #16
01satkins Sat, 05 Dec 2009 19:11:37something else
- #15
ddumont Sat, 05 Dec 2009 18:59:27Are you using this for WIM? Or has the project not surfaced on wowace yet?
- #14
01satkins Sat, 05 Dec 2009 18:57:56Done: http://www.wowace.com/addons/lib-st/tickets/23-set-data-format-change/
And yes, I'm working with about 5 different tables having between 100 and 3000 rows each, it starts stacking up VERY quickly