UI Events

Events have changed in lib-st.

You can now register any event you want for your scrolling table, and these events will be fired for each cell.

To register your event call the function '''RegisterEvents''' and pass in a table of your events paired with their handlers:

local st = ScrollingTable:CreateST();
st:RegisterEvents({
    ["OnClick"] = function (rowFrame, cellFrame, data, cols, row, realrow, column, scrollingTable, ...)
        --[[ handle onclick event here ]]--

        --[[ return true to have your event override the default one
             return false, or nothing at all to have the deafult handler 
                processed after yours.
             The default OnClick handler for example, handles column sorting clicks.
             if row and realrow are nil, then this is a column header cell ]]--
        
    end,
});

Arguments

All event handlers will be supplied the following arguments...

rowFrame

This is the UI Frame table for the row.

cellFrame

This is the UI Frame table for the cell in the row.

data

This is the data table supplied to the scrolling table (in case you lost it :) )

cols

This is the cols table supplied to the scrolling table (again, in case you lost it :) )

row

This is the number of the UI row that the event was triggered for.<br/> ex. If your scrolling table only shows ten rows, this number will be a number between 1 and 10.

realrow

This is the exact row index (after sorting and filtering) in the data table of what data is displayed in the row you triggered the event in. (NOT the UI row!)

column

This is the index of which column the event was triggered in.

scrollingTable

This is a reference to the scrollingtable table.

...

Any arguments generated by the '''NORMAL''' Blizzard event triggered by the frame are passed as is.

Hint

To aquire the actual data of the cell for the event that was triggered, you can do this in your handler function:

local celldata = data[realrow].cols[column];

Comments

  • To post a comment, please or register a new account.
Posts Quoted:
Reply
Clear All Quotes