|
Events are used to customise the behaviour of the control. The following client-side events can be assigned a client-side method using the bind method. All the handlers are passed as the first argument a reference to the control that fired the event. Some events are passed an object as a second argument that contains properties that are related to that particular event. Those events which are cancelable contain a cancel property which can be set to true to suppress the related behavior. For example setting the cancel property for the onBeforeRecordDeleted event will suppress the deletion of the record.
onBeforeBulkInsert
This event is fired just before the the selected key values are passed to the server for insertion when BulkInsert is enabled. The event can be used to assign default values to columns in the inserted record.
Arguments
control
|
object
|
Reference to DbNetGrid control
|
args
|
object
|
Contains the following properties
ids
|
string
|
Comma separated list of ids selected from the lookup dialog
|
params
|
object
|
Object containing parameter values that will be assigned to the inserted records.
|
|
Run Sample
onBeforeEditInitialized
This event is fired just before the DbNetEdit control in the Edit Dialog is initialised. The event can be used to make any custom property assignments before the edit control is initialised.
Arguments
control
|
object
|
Reference to DbNetGrid control
|
args
|
object
|
Contains the following properties
editControl
|
object
|
Reference to Edit Dialog DbNetEdit control
|
|
Run Sample
onBeforeInitialized
This event is fired just before the grid is initialized for the first time
Arguments
control
|
object
|
Reference to DbNetGrid control
|
onBeforeMailMerge
This event is fired just before the grid data is merged with a Word mail merge document. Can be used to dynamically assign the Word document with which the grid data should be merged.
Arguments
control
|
object
|
Reference to DbNetGrid control
|
args
|
object
|
Contains the following properties
|
Run Sample
onBeforeOutput
This event is fired just before the grid data is selected for exporting, printing or copying to the clipboard and can be used to customize the output.
Arguments
control
|
object
|
Reference to DbNetGrid control
|
args
|
object
|
Contains the following properties
context
|
string
|
Set to print, copy or save
|
outputTemplate
|
string
|
Template HTML or Path to template file on the server. Placeholders in the format "{key}" can be placed in the template content and will be substituted by values in outputParameters. The template must contain the placeholders "{grid}" and "{grid_css}" that will be substituted with grid content and CSS respectively.
|
outputParameters
|
object
|
Parameter values that are substituted into the outputTemplate
|
|
Run Sample
onBeforeRecordBatchUpdated
This event is fired before a batch of records that have been edited inline (in the grid) are updated.
Arguments
control
|
object
|
Reference to DbNetGrid control
|
args
|
object
|
Contains the following properties
parameters
|
array of objects
|
Each array element contains the data to be applied to the row.
|
primaryKeys
|
array of objects
|
Each array element contains Primary key information for row
|
rowIndex
|
array of numbers
|
Each array element contains the index of the source row
|
|
onBeforeRecordDeleted
This event is fired before a record is deleted and can be used to validate the deletion. Setting the cancel property to false in the handler will suppress the deletion.
Arguments
control
|
object
|
Reference to DbNetGrid control
|
args
|
object
|
Contains the following properties
cancel
|
boolean
|
Set to true if validation fails
|
message
|
string
|
Message to be displayed for failed validation
|
|
Run Sample
onBeforeRecordValidated
This event is fired just before a record is validated prior to update in the Edit Dialog. It allows for any required checking or manipulation of the data prior to validation.
See onBeforeRecordValidated
onBeforeTinyMceInit
This event is fired just before the TinyMCE HTML Editor is initialized and provides and opportunity to customise the configuration of the HTML Editor.
See onBeforeTinyMceInit
onBeforeUserProfileSaved
This event is fired before a user profile is saved and offers an opportunity to save custom values in the user profile.
Arguments
control
|
object
|
Reference to DbNetGrid control
|
args
|
object
|
Contains the following properties
profile
|
object
|
Object containing properties to be saved. Additional custom values can be added to the property in the event handler and these will be saved in the profile
|
|
Run Sample
onBeforeUserProfileRestored
This event is fired before a user profile is restored and offers an opportunity to process any custom values that might have been saved.
Arguments
control
|
object
|
Reference to DbNetGrid control
|
args
|
object
|
Contains the following properties
profile
|
object
|
Object containing saved properties
|
|
Run Sample
onCellTransform
This event is fired for each cell in the grid just after the page is displayed, printed, copied or saved (if customSave is true)
Arguments
control
|
object
|
Reference to DbNetGrid control
|
args
|
object
|
Contains the following properties
cell
|
object
|
Reference to the grid cell
|
row
|
object
|
Reference to the grid cell row
|
columnName
|
string
|
The name of the column
|
context
|
string
|
Set to display, print, copy, save or view depending on context in which the event is being invoked
|
|
Run Sample
onColumnSort
The onColumnSort event fires when a heading row is click to sort the data by the selected column. The event can be used to implement sorting in a stored procedure which by default does not support sorting.
control
|
object
|
Reference to DbNetGrid control
|
args
|
object
|
Contains the following properties
columnName
|
string
|
The name of the column
|
sequence
|
string
|
"asc" or "desc"
|
|
onColumnsSelected
The onColunmsSelected event fires when a heading row is click to sort the data by the selected column. The event can be used to implement sorting in a stored procedure which by default does not support sorting. Setting the cancel property to false in the handler will suppress the deletion.
control
|
object
|
Reference to DbNetGrid control
|
args
|
object
|
Contains the following properties
cancel
|
boolean
|
Set to true to cancel the selection of columns
|
message
|
string
|
Message to be displayed if selection is canceled
|
selectedColumns
|
array of objects
|
Each object in the array has a value and text property representing the column name and column label
|
unselectedColumns
|
array of objects
|
Each object in the array has a value and text property representing the column name and column label
|
|
Run Sample
onColumnValidate
Invoked before a record is updated or added in the Edit Dialog. Use event to validate individual column values. Use onRecordValidate to validate values across the whole record when you need to compare one field value against another.
See onColumnValidate
Run Sample
onDependentListLoaded
This event is fired when a dependent combo box is loaded after the value in the value in the parent combo changes.
Arguments
control
|
object
|
Reference to DbNetGrid control
|
args
|
object
|
Contains the following properties
target
|
object
|
Reference to the combo-box element
|
|
onEditDialogInitialized
This event is fired when the edit dialog is initialized.
Arguments
control
|
object
|
Reference to DbNetGrid control
|
args
|
object
|
Contains the following properties
editControl
|
object
|
Reference to the DbNetEdit control in the Edit dialog
|
|
onFieldValueChanged
Invoked when a value in the Edit Dialog is modified
See onFieldValueChanged
Run Sample
onFilterColumnChange
This event is fired after a column filter changes
Arguments
control
|
object
|
Reference to DbNetGrid control
|
args
|
object
|
Contains the following properties
target
|
object
|
Reference to the filter that triggered the change
|
filters
|
array of objects
|
Array of references to all the filter elements
|
|
onHeaderCellTransform
This event is fired for each header cell in the grid just after the page is displayed, printed, copied or saved (if customSave is true)
Arguments
control
|
object
|
Reference to DbNetGrid control
|
args
|
object
|
Contains the following properties
cell
|
object
|
Reference to the header cell
|
columnName
|
string
|
The name of the column
|
context
|
string
|
Set to display, print, copy or save depending on context in which the event is being invoked
|
|
Run Sample
onInitialized
This event is fired after the control is initialized
Arguments
control
|
object
|
Reference to DbNetGrid control
|
onInsertInitialize
Invoked when a record in the Edit Dialog is initialized for insertion
See onInsertInitialize
Run Sample
onOutput
This event is just before the document is output and can be used to customize the output by manipulating the document passed as an argument to the event handler.
Arguments
control
|
object
|
Reference to DbNetGrid control in the Edit dialog
|
args
|
object
|
Contains the following properties
context
|
string
|
Set to print, copy or save
|
window
|
object
|
Reference to the output document window
|
document
|
object
|
Reference to the output document
|
body
|
object
|
Reference to the output document body
|
table
|
object
|
Reference to the grid output table
|
|
Run Sample
onPageLoaded
This event is fired after each grid page is loaded
Arguments
control
|
object
|
Reference to DbNetGrid control
|
args
|
object
|
Contains the following properties
table
|
object
|
Reference to the grid table
|
initialLoad
|
bool
|
True is this is the first page load after the initialisation of the component
|
|
Run Sample
onParentFilterAssigned
This event is fired immediately after the parent filter is assigned for a dependent grid. The event can used to customise the filter applied to the child grid via the parentFilterSql and parentFilterParameters properties.
Arguments
control
|
object
|
Reference to DbNetGrid control
|
args
|
object
|
Contains the following properties
parentControl
|
object
|
Reference to the parent control
|
|
onRecordBatchUpdated
This event is fired after a batch of records that have been edited inline (in the grid) are updated.
Arguments
control
|
object
|
Reference to DbNetGrid control
|
onRecordDeleteError
This event is fired if an error is encountered during the deletion of a record. The message property can be modified before being displayed to the end user.
Arguments
control
|
object
|
Reference to DbNetGrid control
|
args
|
object
|
Contains the following properties
message
|
string
|
The deletion error message returned from the server.
|
|
onRecordDeleted
This event is fired after a record or records are deleted.
Arguments
control
|
object
|
Reference to DbNetGrid control
|
args
|
object
|
Contains the following properties
deleted
|
array of objects
|
An array of of the records deleted
|
|
Run Sample
onRecordInsertError
Invoked when an error is encountered adding a record in the Edit Dialog
See onRecordInsertError
Run Sample
onRecordInserted
Invoked when a record is added in the Edit Dialog
See onRecordInserted
Run Sample
onRecordSelected
Invoked when a record is selected for update in the Edit Dialog
See onRecordSelected
onRecordUpdateError
Invoked when an error is encountered updating a record in the Edit Dialog
See onRecordUpdateError
Run Sample
onRecordUpdated
Invoked when a record is updated in the Edit Dialog
See onRecordUpdated
onRowSelected
This event is fired after row in the grid is selected either by button navigation or when a user clicks on a row
Arguments
control
|
object
|
Reference to DbNetEdit control
|
args
|
object
|
Contains the following properties
row
|
object
|
Reference to the selected row object
|
|
Run Sample
onRowTransform
This event is fired for each data row in the grid just after the page is displayed, printed, copied or saved (if customSave is true)
Arguments
control
|
object
|
Reference to DbNetGrid control
|
args
|
object
|
Contains the following properties
row
|
object
|
Reference to the grid data row
|
context
|
string
|
Set to display, print, copy or save depending on context in which the event is being invoked
|
|
Run Sample
onRecordValidate
Invoked before a record is updated or added in the Edit Dialog. Use event to validate values across the whole record when you need to compare one field value against another. Use onColumnValidate to validate individual column values. The event can also be used to programmatically assign values to a record such as a timestamp.
See onRecordValidate
Run Sample
onSearchDialogApply
This event is fired after the apply button is pressed in the search dialog and before the criteria are sent to the server. It provides an opportunity to modify the search criteria. The search sql and parameters are contained in the searchFilter property.
Arguments
control
|
object
|
Reference to DbNetGrid control
|
Run Sample
onSearchPanelInitialized
This event is fired after the search panel is initialized and can be used to customise the search panel.
Arguments
control
|
object
|
Reference to DbNetGrid control
|
args
|
object
|
Contains the following properties
searchPanel
|
object
|
Reference to the searchPanel object
|
|
onToolbarConfigured
This event is fired every time the toolbar buttons are enabled/disabled in response to a change in the controls state. It can be used to synchronise the state of any custom buttons with those in the toolbar
Run Sample
onUniqueConstraintViolated
Event used to customise the message when unique columns are duplicated
See onUniqueConstraintViolated
Run Sample
onValidationFailed
This event is fired when server-side validation prior to update fails for example in the validation of dates and number.
See onValidationFailed
onViewDialogInitialized
This event is fired after the view dialog is initialized
Arguments
control
|
object
|
Reference to DbNetGrid control
|
args
|
object
|
Contains the following properties
dialog
|
object
|
Reference to the view dialog
|
|
onViewOutput
This event is fired before a record is printed or copied in the view dialog
Arguments
control
|
object
|
Reference to DbNetGrid control in the Edit dialog
|
args
|
object
|
Contains the following properties
context
|
string
|
Set to print or copy
|
window
|
object
|
Reference to the output document window
|
document
|
object
|
Reference to the output document
|
body
|
object
|
Reference to the output document body
|
record
|
object
|
Object with properties corresponding to the view columns containing data for the selected record
|
|
Run Sample
onViewRecordSelected
This event is fired after a record is selected in the view dialog
Arguments
control
|
object
|
Reference to DbNetGrid control
|
args
|
object
|
Contains the following properties
dialog
|
object
|
Reference to the view dialog
|
record
|
object
|
Object with properties corresponding to the view columns containing data for the selected record
|
|
Run Sample
|