Get a table cell.
// Get table
var tableCtrl = ix.api.dom.getControl("<TABLE-GUID>");
// Get all columns
var cols = tableCtrl.getCols();
// Get all cells of first column
var cells = cols[0].getCells();
// Get html element of first cell
var firstCell = cells[0].getHtml()[0];
console.log(firstCell);
// Get table
var tableCtrl = ix.api.dom.getControl("<TABLE-GUID>");
// Get rows
var rows = tableCtrl.getRows();
// Get cells of first row
var firstRowCells = rows[0].getCells();
// Get html element of first cell
var firstCell = firstRowCells[0].getHtml()[0];
// Change background color of first cell in first row
firstCell.style.backgroundColor = "blue";
Returns a jQuery list with one or more HTML nodes (e.g. <tr>
or <li>
).
// Get table
var tableCtrl = ix.api.dom.getControl("<TABLE-GUID>");
// Get all columns
var rows = tableCtrl.getRows();
// Get html element of first row
var firstRow = rows[0].getHtml()[0];
// Change first rows background color to blue
firstRow.style.backgroundColor = "blue";
Get the records actual position.
// Get table
var tableCtrl = ix.api.dom.getControl("<TABLE-GUID>");
// Get rows
var rows = tableCtrl.getRows();
// Iterate over each row
rows.forEach((row) => {
// Get row position
var rowPosition = row.getRecPosition();
// Check if row position is even and style all even rows background color green
if (rowPosition % 2 === 0) {
var rowHtml = row.getHtml()[0];
rowHtml.style.backgroundColor = "green";
}
});
Hides the record row.
// Get table
var tableCtrl = ix.api.dom.getControl("<TABLE-GUID>");
// Get rows
var rows = tableCtrl.getRows();
// Iterate over each row
rows.forEach((row) => {
// Get row position
var rowPosition = row.getRecPosition();
// Check if row position is even and hide them so only odd rows are shown
if (rowPosition % 2 === 0) {
row.hide();
}
});
Represents a table row - a collection of cell objects (Cell).
Example