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
componentIdis the original ID of theGridControl. - The client-side function rbf_getGridControlComponent(gridNo), where
gridNois the order in which thisGridControlcomponent 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 theGridControldeleteGridRow(rowIndex)— Removes theGridRowat the specified row indexgetContentElement()— Returns a jQuery object for the root element housing theGridControlcomponentgetFieldCell(rowIndex, fieldName)— Returns a jQuery object of the field container element where the field is identified byrowIndexandfieldNamegetGridControlSectionToolbarEl()— Returns a jQuery object for theGridControlsection toolbar elementgetGridControlToolbar()— Returns a jQuery object for theGridControltoolbar elementgetGridControlToolbarEl()— Returns a Kendo Toolbar configuration object for theGridControltoolbargetGridNumber()— Returns the order of theGridControlcomponent on the pagegetGridRow(rowIndex)— Returns theGridRowobject at the specified row index, whererowIndexis the number of the row (the first row has therowIndexof0). See GridRow for more information.getId()— Returns theGridControlcomponent'sPageCell's IDgetKendoConfig()— Returns the Kendo Grid configuration object for theGridControlcomponentgetLastModifiedField()— Returns theFieldContextobject of the last modified field. See FieldContext for more information.getMaxRowIndex()— Returns the number of grid rows in theGridControlcomponentgetOriginalId()— Returns theGridControlcomponent'sPageCell's originalIDremoveEventListener(eventType,handler)— Unregisters an event listener for the specifiedeventTypeshowGridTotals()— Computes and shows grid totals for each TotalBy column in theGridControlcomponentsumGridColumn(fieldName)— Computes and shows the grid total for the specifiedGridControlcolumn 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>