lib-ScrollingTable

lib-st in action!

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

Known consumers of lib-st

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of ddumont ddumont Sun, 20 Dec 2009 05:13:50

    :) Thanks!

  • Avatar of chaosknightz chaosknightz Sun, 20 Dec 2009 04:47:09

    works great thanks for all the help, you rock!

  • Avatar of ddumont ddumont Sat, 19 Dec 2009 21:13:38

    Hi. As for the ace gui frame, make sure you are getting the actual frame object. I think it's something like:

        local parent = aceframe.frame;
    

    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!

    Last edited on 19 Dec 2009 by ddumont
  • Avatar of chaosknightz chaosknightz Sat, 19 Dec 2009 18:33:04

    im 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

    Last edited on 19 Dec 2009 by chaosknightz
  • Avatar of ddumont ddumont Thu, 10 Dec 2009 12:41:44

    Hi!

    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.

  • Avatar of Corg Corg Thu, 10 Dec 2009 05:37:13

    Hi DDumont,

    The latest version of this library appears to have a bug. fRealRow should be renamed to isRealRow.

    	local function GetRow(self, row, isRealRow)
    		if fRealRow then 
    			return self.data[row];
    		else
    			return self.data[self.sorttable[row]];
    		end
    	end
    

    It's messing up the sorting in my mod and I was hoping to get my new mod approved for release this week.

    Thanks!

    Last edited on 10 Dec 2009 by Corg
  • Avatar of ddumont ddumont Sat, 05 Dec 2009 19:13:57

    Are 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 :)

  • Avatar of 01satkins 01satkins Sat, 05 Dec 2009 19:11:37

    something else

  • Avatar of ddumont ddumont Sat, 05 Dec 2009 18:59:27

    Are you using this for WIM? Or has the project not surfaced on wowace yet?

  • Avatar of 01satkins 01satkins Sat, 05 Dec 2009 18:57:56

    Done: 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

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
  • R: v3.8 for 3.3.0 on 07 Jan 2010
  • A: r136 for 3.3.0 on 07 Jan 2010
  • R: v3.7 for 3.3.0 on 23 Dec 2009
  • A: r134 for 3.3.0 on 21 Dec 2009
  • A: r133 for 3.3.0 on 12 Dec 2009

Authors

Relationships

Embedded library
LibStub