JS Grid Control Events
Applies to: SharePoint Foundation 2010
The JS Grid control offers the following client side events:
JS Grid Events
Event |
Description |
---|---|
Occurs before the grid is disposed. Occurs once in the lifetime of the control. |
|
Occurs when the user begins editing (such as by a keystroke, double-click) in an edit control or widget. |
|
Occurs after the user has finished editing a cell using an edit control or widget. |
|
Occurs when the cell error state is added or removed. |
|
Occurs after the cell focus changes. |
|
Occurs when the user double-clicks on the cell. |
|
Occurs when a new entry record appears on the JS Grid control. |
|
Occurs when the record entry is committed; that is, when an entry record has successfully added to the JS Grid control table cache. |
|
Occurs when an entry record’s property is changed. This includes all user and programmatic edits. |
|
Occurs when the grid goes from a state of having one or more errors to having no errors, or the reverse. |
|
OnInitialChangesForChangeKeyComplete(changeKey) |
Occurs the first time all changes associated with a given change key have been validated; that is, no asynchronous calls pending). |
Occurs when a record’s property is changed, including all user and programmatic edits. |
|
Occurs when one or more records is checked or unchecked by using the record indicator check box. |
|
Occurs when a record is deleted. |
|
Occurs when a record is inserted. |
|
Occurs when the user right-clicks the cell. |
|
Occurs when the error state of a row changes. |
|
Occurs when the row focus changes. |
|
OnSingleCellClick |
Occurs when the user single clicks in a cell. |
Occurs when a single key is pressed. |
|
Occurs when the grid is no longer tracking a specified change. |
Attaching to Events
This example shows how to attach custom code to the OnCellEditComplete event.
<script type="text/javascript">
Type.registerNamespace("GridManager");
GridManager = function () {
this.Init = function (jsGridControl, initialData, props) {
control = jsGridControl;
var dataSource = new SP.JsGrid.StaticDataSource(initialData);
var jsGridParams = dataSource.InitJsGridParams();
// This event is triggered after the standard grid error checking
jsGridControl.AttachEvent(SP.JsGrid.EventType.OnCellEditCompleted, GotHere);
jsGridControl.Init(jsGridParams);
}
};
function GotHere(obj) {
alert('Got here, ' + obj.fieldKey);
}
</script>
See Also
Reference
Concepts
Other Resources
JS Grid Control Functions