Introduction
The utility functions described here are used by the JavaScript code of the UltraWebGrid Control. The purpose of exposing and documenting them is to allow developers to put as much logic as possible on the client machine in order to obtain gains in both performance and functionality.
Many of these Utility functions are involved with more than simply returning a property value. They are concerned with 'resolving' the property value according to an ordered set of precedance rules. The rules of precedance are straightforward: Check the local value first, if that value is 0, meaning notset, check the next most local value. This may be the Row, Column, Band or Grid. Repeat the procedure until either a value is found, or the Grid object default is encountered and applied.
HTML ID Formats
Many functions and properties are based on the Id of elements within the page. The Ids of elements is based upon a method of identifying Table and Cell objects uniquely as to owner and position within the Document Object Model, (DOM) of the page. The element most commonly used for funciont calls is the <TD> tag element. The Id of <TD> the tag is made up of several distinct components that are interpreted by the JavaScript in order to identify the position of the <TD> tag or cell within the DOM. The following Id is an example of a typical <TD> tag Id representing a cell:
<td id='UltraWebGrid1rc_3_2_4'>
The components of the Id are delimited by the underscore character. The first component indicates the Id of the owning grid. The next component is the object type identifier: in this case 'rc', indicating that the object is a cell. If the object is a cell, the last component indicates the column number within the band that the cell belongs to. The components between the object type identifier and the last position indicate the row position of the cell within the band hierarchy. In this case the Id indicates the 4th column within the 2nd child row of the 3rd top-level row of the grid. The number of bands references by the Id is equal to the total number of components in the Id minus 2.
The following Id is an example of a typical <TH> tag Id representing a column:
<td id='UltraWebGrid1c_2_4'>
The first component indicates the Id of the owning grid. The next component is the object type identifier: in this case 'c', indicating that the object is a column. The next component is the index of the Band to which the column belongs. And the last component is the index of the column within the band.
Functions
To see a description and example of the function, click on the text of the function.
If you want to see all of the function definitions and examples expanded, click here.
To collapse all definitions and examples, click here.
function igcmbo_getComboById(string comboId)
var oCombo = igcmbo_getComboById('WebCombo1');
function igtbl_getElementById(string tagId)
var elem = igtbl_getElementById('MyElemId');
elem.style.backgroundColor = "Red";
function igtbl_getGridById(string gridId)
var grid = igtbl_getGridById('UltraWebGrid1');
grid.AllowUpdate = false;
function igtbl_getBandById(string cellId)
var band = igtbl_getBandById('UltraWebGrid1_2_3_1_4');
function igtbl_getColumnById(string cellId)
var column = igtbl_getColumnById('UltraWebGrid1_2_3_1_4');
function igtbl_getRowById(string CellId)
var row = igtbl_getRowById('UltraWebGrid1_2_3_1_4');
function igtbl_getCellById(string CellId)
igtbl_getElementById
in that it returns a new object that exposes special properties of a grid Cell as opposed to the HTML DOM object that represents the <TD> tag within the HTML page. See Cell Object.
var cell = igtbl_getCellById('UltraWebGrid1_2_3_1_4');
function igtbl_getActiveCell(string gridName)
var cell = igtbl_getActiveCell('UltraWebGrid');
function igtbl_getActiveRow(string gridName)
var row = igtbl_getActiveRow('UltraWebGrid');
function igtbl_isCell(string itemName)
var bCell = igtbl_isCell('UltraWebGrid1rc_1_3');
function igtbl_isRowLabel(string itemName)
var bRowLabel = igtbl_isRowLabel('UltraWebGrid1l_1_3');
function igtbl_isColumnHeader(string itemName)
var bColHeader = igtbl_isColumnHeader('UltraWebGrid1c_1_3');
function igtbl_getCollapseImage(string gridName, int bandNo)
var image = igtbl_getCollapseImage('UltraWebGrid1', 0);
function igtbl_getExpandImage(string gridName, int bandNo)
var image = igtbl_getExpandImage('UltraWebGrid1', 0);
function igtbl_getCellClickAction(string gridName, int bandNo)
var clickAction = igtbl_getCellClickAction('UltraWebGrid1', 0);
function igtbl_getSelectTypeCell(string gridName, int bandNo)
var selectType = igtbl_getSelectTypeCell('UltraWebGrid1', 0);
function igtbl_getSelectTypeColumn(string gridName, int bandNo)
var selectType = igtbl_SelectTypeColumn('UltraWebGrid1', 0);
function igtbl_getSelectTypeRow(string gridName, int bandNo)
var selectType = igtbl_getSelectTypeRow('UltraWebGrid1', 0);
function igtbl_getHeaderClickAction(string gridName, int bandNo, int columnNo)
var clickAction = igtbl_getHeaderClickAction('UltraWebGrid1', 0, 2);
function igtbl_getAllowUpdate(string gridName, int bandNo, int columnNo)
var update = igtbl_getAllowUpdate('UltraWebGrid1', 0, 3);
function igtbl_getAllowColSizing(string gridName, int bandNo, int columnNo)
var sizing = igtbl_getAllowColSizing('UltraWebGrid1', 0, 2);
function igtbl_getRowSizing(string gridName, int bandNo, string row)
var sizing = igtbl_getRowSizing('UltraWebGrid1', 0, 'UltraWebGrid1r_3');
function igtbl_getRowSelectors(string gridName, int bandNo)
1 = Yes
2 = No
var selectors = igtbl_getRowSelectors('UltraWebGrid1', 0);
function igtbl_getNullText(string gridName, int bandNo, int columnNo)
var image = igtbl_getNullText('UltraWebGrid1', 0, 5);
function igtbl_getEditCellClass(string gridName, int bandNo)
var class = igtbl_getEditCellClass('UltraWebGrid1', 0);
function igtbl_getFooterClass(string gridName, int bandNo, int columnNo)
var Class = igtbl_getFooterClass('UltraWebGrid1', 0, 4);
function igtbl_getGroupByRowClass(string gridName, int bandNo)
var class = igtbl_getGroupByRowClass('UltraWebGrid1', 0);
function igtbl_getHeadClass(string gridName, int bandNo, int columnNo)
var class = igtbl_getHeadClass('UltraWebGrid1', 0);
function igtbl_getRowLabelClass(string gridName, int bandNo)
var class = igtbl_getRowLabelClass('UltraWebGrid1', 0);
function igtbl_getSelGroupByRowClass(string gridName, int bandNo)
var class = igtbl_getSelGroupByRowClass('UltraWebGrid1', 0);
function igtbl_getSelHeadClass(string gridName, int bandNo, int columnNo)
var class = igtbl_getSelHeadClass('UltraWebGrid1', 0);
function igtbl_getSelCellClass(string gridName, int bandNo, int columnNo)
var class = igtbl_getSelCellClass('UltraWebGrid1', 0);
function igtbl_getExpAreaClass(string gridName, int bandNo)
var class = igtbl_getExpAreaClass('UltraWebGrid1', 0);
function igtbl_toggleRow(string gridName, string srcRow, boolean expand)
gn - the grid name
srcRow - the Id of the row to be toggled
expand - if True, the rows is expanded. If False, the row is collapsed
igtbl_toggleRow('UltraWebGrid1', 'UltraWebGrid1r_1_2', true);
function igtbl_clearSelectionAll(string gridName)
gn - the grid name.
igtbl_clearSelectionAll('UltraWebGrid1');
function igtbl_selectCell(string gridName, string cellId, boolean selFlag, boolean fireEvent)
gn - the grid name
cellId - the id of the cell
selFlag - if True, the cell is selected. If False, the cell is unselected
fireEvent - if true, an event is fired to listeners.
igtbl_selectCell('GltraWebGrid1', 'UltraWebGrid1_1_2_3', true, false);
function igtbl_selectRow(string gridName, string rowId, boolean selFlag, boolean fireEvent)
gn - the grid name
rowId - the id of the row
selFlag - if True, the row is selected. If False, the row is unselected
fireEvent - if True, an event is fired to listeners.
igtbl_selectRow('UltraWebGrid1', 'UltraWebGrid1r_1_2', true, false);
function igtbl_selectColumn(string gridName, string columnId, boolean selFlag, boolean fireEvent)
gn - the grid name
columnId - the id of the column
selFlag - if True, the column is selected. If False, the column is unselected
fireEvent - if True, an event is fired to listeners.
igtbl_selectColumn('UltraWebGrid1', 'UltraWebGrid1c_1_2', true, false);
function igtbl_setActiveCell(string gridName, element cell)
gn - the grid name
cell - the cell element
var cell= igtbl_getActiveCell();
cell = cell.NextSibling;
if(cell != null)
igtbl_setActiveCell('UltraWebGrid1', cell);
function igtbl_setActiveRow(string gridName, element row)
gn - the grid name
row - the row element
var row = igtbl_getActiveRow();
row = row.NextSibling;
if(row != null)
igtbl_setActiveRow('UltraWebGrid1', row);
function igtbl_getInnerText(sourceElement)
var innerText = igtbl_getInnerText(igtbl_getElementById('UltraWeGrid1_1_3_4_1'));
var innerText = igtbl_getInnerText('UltraWebGrid1_1_1');
function igtbl_setInnerText(sourceElement, strText)
igtbl_setInnerText(igtbl_getElementById('UltraWeGrid1_1_3_4_1'), 'Cell Value');
igtbl_setInnerText('UltraWebGrid1_1_2', "newValue");
function igtbl_scrollToView(gn, child)
gn - the grid name
child - the DOM object you want to place into view. The child parameter has to be a child of the grid.
var row = igtbl_getElementById(rowId);
igtbl_scrollToView(gn, row);