API
ClearSelection(self)
Clear the currently selected row.
You should not need to refresh the table.
Parameters
- self
Usage
st:ClearSelection()
CompareSort(self, rowa, rowb, sortbycol)
CompareSort function used to determine how to sort column values.
Can be overridden in column data or table data.
Parameters
- self
- rowa
- rowb
- sortbycol
Usage
used internally.
See also
- Core.lua
DoCellUpdate(rowFrame, cellFrame, data, cols, row, realrow, column, fShow, table, ...)
Cell update function used to paint each cell.
Can be overridden in column data or table data.
Parameters
- rowFrame
- cellFrame
- data
- cols
- row
- realrow
- column
- fShow
- table
- ...
Usage
used internally.
See also
EnableSelection(self, flag)
Turn on or off selection on a table according to flag.
Will not refresh the table display.
Parameters
- self
- flag
Usage
st:EnableSelection(true)
GetCell(self, row, col)
Returns the cell data of the given row from the given row and column index
Parameters
- self
- row
- col
Usage
used internally.
GetRow(self, realrow)
Returns the data row of the table from the given data row index
Parameters
- self
- realrow
Usage
used internally.
GetSelection(self)
Gets the currently selected to row.
Return will be the unaltered index of the data row that is selected.
Parameters
- self
Usage
st:GetSelection()
Hide(self)
Used to hide the scrolling table when shown.
Parameters
- self
Usage
st:Hide()
IsRowVisible(self, realrow)
Checks if a row is currently being shown
Parameters
- self
- realrow
Usage
st:IsRowVisible(realrow)
RegisterEvents(self, events, fRemoveOldEvents)
Set the event handlers for various ui events for each cell.
Parameters
- self
- events
- fRemoveOldEvents
Usage
st:RegisterEvents(events, true)
See also
SetData(self, data, isMinimalDataformat)
Sets the data for the scrolling table
Parameters
- self
- data
- isMinimalDataformat
Usage
st:SetData(datatable)
See also
SetDisplayCols(self, cols)
Set the column info for the scrolling table
Parameters
- self
- cols
Usage
st:SetDisplayCols(cols)
See also
SetDisplayRows(self, num, rowHeight)
Set the number and height of displayed rows
Parameters
- self
- num
- rowHeight
Usage
st:SetDisplayRows(10, 15)
SetFilter(self, Filter)
Set a display filter for the table.
Parameters
- self
- Filter
Usage
st:SetFilter( function (self, ...) return true end )
See also
SetHighLightColor(self, frame, color)
Set the row highlight color of a frame ( cell or row )
Parameters
- self
- frame
- color
Usage
st:SetHighLightColor(rowFrame, color)
See also
SetSelection(self, realrow)
Sets the currently selected row to 'realrow'.
Realrow is the unaltered index of the data row in your table. You should not need to refresh the table.
Parameters
- self
- realrow
Usage
st:SetSelection(12)
Show(self)
Used to show the scrolling table when hidden.
Parameters
- self
Usage
st:Show()
SortData(self)
Resorts the table using the rules specified in the table column info.
Parameters
- self
Usage
st:SortData()
There's a typo in the source code. `IsRowVisible()` is actually exposed as `RowIsVisible()` via the API. So if anyone needs that function, just type the alternative name. I'm trying to use that function to check if a database row I'm modifying is visible and if so, I call `Refresh()` to re-draw the visible rows.
Edit: Nevermind. It doesn't matter. The code in `IsRowVisible()` in this library is **completely** bugged. It is comparing the real row number (of something in your data array) against the virtual row `offset` number of the FauxScrollingFrame. So, let's say you've scrolled down a bit and the 1st row of your FauxScrollingFrame is at `offset` 21 and is displaying data[2]. In this case, the `IsRowVisible()` function would check if `realrow > offset` and fails completely to find the row. It's literally completely broken and there is nothing salvageable about the current code.
To make this broken library function work, it would have to be totally rewritten to have a loop which checks all positions in `.filtered[]` (the array of "sorted offsets in the order to be displayed"), starting from scrolltable's `.offset` all the way to `.offset + .displayRows`, and checks if any of those contain the number of the real row you're looking for.
If anyone wants to to code a fix for themselves, keep in mind that `.offset` starts at 0 whereas `.filtered`'s array entries count up from 1...
Edit 2: Alright, I've fixed and quadruple-checked things to make sure it's now perfect. Here's the bugfix for `IsRowVisible()`. I'll also be posting this on the project front-page/comments section.