Get a table cell.
// Get table
var tableCtrl = ix.api.dom.getControl("<TABLE-GUID>");
// Get all rows
var rows = tableCtrl.getRows();
// Get first row
var firstRow = rows[0];
// Get cell by its guid
var cell = rows[0].getCell("<CELL-GUID>");
console.log(cell);
var cellHtml = cell.getHtml(true);
console.log(cellHtml);
// 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(true);
// 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>
) or a HTMLElement.
Optional
asNode: booleanIf true, returns a HTMLElement, otherwise a jQuery object.
// 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(true);
// 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