GridControl
Purpose
GridControl
is a client-side JavaScript
object that represents a grid control on an application page.
Access a GridControl in one of two ways:
- The client-side function rbf_getPageComponent(componentId), where
componentId
is the original ID of theGridControl
. - The client-side function rbf_getGridControlComponent(gridNo), where
gridNo
is the order in which thisGridControl
component appears on the page.
Interface
The GridControl
component has the following public interface:
addEventListener(eventType,handler)
— Registers an event listener for the given event typeaddGridRow()
— Adds a new grid row to theGridControl
deleteGridRow(rowIndex)
— Removes theGridRow
at the specified row indexgetContentElement()
— Returns a jQuery object for the root element housing theGridControl
componentgetFieldCell(rowIndex, fieldName)
— Returns a jQuery object of the field container element where the field is identified byrowIndex
andfieldName
getGridControlSectionToolbarEl()
— Returns a jQuery object for theGridControl
section toolbar elementgetGridControlToolbar()
— Returns a jQuery object for theGridControl
toolbar elementgetGridControlToolbarEl()
— Returns a Kendo Toolbar configuration object for theGridControl
toolbargetGridNumber()
— Returns the order of theGridControl
component on the pagegetGridRow(rowIndex)
— Returns theGridRow
object at the specified row index, whererowIndex
is the number of the row (the first row has therowIndex
of0
). See GridRow for more information.getId()
— Returns theGridControl
component'sPageCell
's IDgetKendoConfig()
— Returns the Kendo Grid configuration object for theGridControl
componentgetLastModifiedField()
— Returns theFieldContext
object of the last modified field. See FieldContext for more information.getMaxRowIndex()
— Returns the number of grid rows in theGridControl
componentgetOriginalId()
— Returns theGridControl
component'sPageCell
's originalIDremoveEventListener(eventType,handler)
— Unregisters an event listener for the specifiedeventType
showGridTotals()
— Computes and shows grid totals for each TotalBy column in theGridControl
componentsumGridColumn(fieldName)
— Computes and shows the grid total for the specifiedGridControl
column as identified byfieldName
Example
The following example returns the original ID of the first grid control on the page.
<script> rbf_getGridControlComponent(0).getOriginalId(); </script>