The DataGridCellContainer Object

During the development process, you might need to access a returned results set (either the entire set of data or just a subset you selected) after executing a SQL query. In the screenshot below, you can see that there are three pages containing 206 rows in the returned results set. The TeamSQL client allows you to apply pagination to the results set as shown:

You can select cells and rows as follows:

Your extension can access some or all of the data you returned using the SDK's functions, specifically using the allData and selectedData parameters.

Parameter Type Definition
allData DataGridCellContainer[] All rows and cells, regardless of pagination
selectedData DataGridCellContainer[] Returns only the selected portion of your data

Please see the MenuItems docs to see an in-depth explanation of how TeamSQL passes your data to your extension.

You'll see that the allData and selectedData parameters are sent by the SDK to callback functions:

let menuItem1 = new MenuItem("Lookup Email", null, (selectedData: DataGridCellContainer[], allData: DataGridCellContainer[]) => {
    ...
});

DataGridCellContainer Object Structure

The DataGridCellContainer object has 3 properties:

cells: ( Array<DataGridCell> ) An array of DataGridCell object

cellList: ( {[index: number]: DataGridCell} ) A dictionary object with key-value pairs -- the key is the index value referring to the cell, the value is the DataGridCell

rowIndex: ( number ) An index of the current row

DataGridCell Object Structure

The DataGridCell object contains identifying information for a particular cell:

cellIndex: ( number ) The index of the cell

rowIndex: ( number ) The index of the row to which the cell belongs

columnName: ( string ) The name of the column containing the cell

value: ( any ) The value of the cell

type: ( string ) The data type of cell. Valid types include string, date, number, boolean, unknown

results matching ""

    No results matching ""