|
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.
onBeforeInitialized
This event is fired just before the grid is initialized for the first time
Arguments
control
|
object
|
Reference to DbNetEdit control
|
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 DbNetEdit 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. It allows for any required checking or manipulation of the data prior to validation.
Arguments
control
|
object
|
Reference to DbNetEdit control
|
args
|
object
|
Contains the following properties
cancel
|
boolean
|
Set to true if pre-validation fails
|
message
|
string
|
Message to be displayed for failed pre-validation
|
|
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.
Arguments
control
|
object
|
Reference to DbNetEdit control
|
args
|
object
|
Contains the following properties
config
|
object
|
The configuration object passed to TinyMCE
|
|
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 DbNetEdit 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
|
|
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 DbNetEdit control
|
args
|
object
|
Contains the following properties
profile
|
object
|
Object containing saved properties
|
|
onColumnValidate
This event is fired for each column in the edit dialog just before the edit is applied. Setting the cancel property on the args parameter causes validation to fail and the update is suppressed.
Arguments
control
|
object
|
Reference to DbNetEdit control
|
args
|
object
|
Contains the following properties
columnValue
|
string|number|boolean|date
|
The value of the column. The type value will be dependent on the column database type. For example date/time columns will be passed a JavaScript dates.
|
columnName
|
string
|
The name of the column
|
cancel
|
boolean
|
Set to true if validation fails
|
message
|
string
|
Message to be displayed for failed validation
|
|
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 DbNetEdit control
|
args
|
object
|
Contains the following properties
target
|
object
|
Reference to the combo-box element
|
|
Run Sample
onEditDialogInitialized
This event is fired when the edit dialog is initialized.
Arguments
control
|
object
|
Reference to DbNetEdit control
|
args
|
object
|
Contains the following properties
editControl
|
object
|
Reference to the DbNetEdit control in the Edit dialog
|
|
onFieldValueChanged
This event is fired after a edit value changes. The column for which the event has been raised can be identified using the args.columnName property
Arguments
control
|
object
|
Reference to DbNetEdit control
|
args
|
object
|
Contains the following properties
editField
|
object
|
Reference to the input element that was modified
|
columnName
|
string
|
The name of the database column for which the event was raised
|
row
|
object
|
The parent grid row. (DbNetGrid Inline Editing Only)
|
|
Run Sample
onFileUploaded
This event is fired after a file has been uploaded as part of an edit.
Arguments
control
|
object
|
Reference to DbNetEdit control
|
args
|
object
|
Contains the following properties
fileName
|
string
|
The name of the file that was uploaded
|
columnName
|
string
|
The name of the database column for which the event was raised
|
|
Run Sample
onInsertInitialize
This event is fired just after a record is initialized in insert mode
Arguments
control
|
object
|
Reference to DbNetEdit control
|
onInitialized
This event is fired after the control is initialized
Arguments
control
|
object
|
Reference to DbNetEdit control
|
onPageLoaded
This event is fired after the edit control is loaded with records
Arguments
control
|
object
|
Reference to DbNetEdit control
|
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 DbNetEdit control
|
args
|
object
|
Contains the following properties
parentControl
|
object
|
Reference to the parent 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 DbNetEdit 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 DbNetEdit control
|
args
|
object
|
Contains the following properties
deleted
|
array of objects
|
An array of of the records deleted
|
|
Run Sample
onRecordInsertError
This event is fired if an error is encountered during the insertion of a record. The message property can be modified before being displayed to the end user.
Arguments
control
|
object
|
Reference to DbNetEdit control
|
args
|
object
|
Contains the following properties
message
|
string
|
The deletion error message returned from the server.
|
|
Run Sample
onRecordInserted
This event is fired after a record has been successfully inserted
Arguments
control
|
object
|
Reference to DbNetEdit control
|
args
|
object
|
Contains the following properties
id
|
number
|
The value of an auto incrementing primary key for the inserted record. -1 where not applicable.
|
inserted
|
object
|
Values for the record that was inserted.
|
message
|
string
|
Message displayed to user to confirm insertion of record
|
|
Run Sample
onRecordSelected
This event is fired after a record has been selected for editing
Arguments
control
|
object
|
Reference to DbNetEdit control
|
args
|
object
|
Contains the following properties
record
|
object
|
Values for the record that was selected.
|
|
onRecordUpdateError
This event is fired if an error is encountered during the updating of a record. The message property can be modified before being displayed to the end user.
Arguments
control
|
object
|
Reference to DbNetEdit control
|
args
|
object
|
Contains the following properties
message
|
string
|
The deletion error message returned from the server.
|
|
Run Sample
onRecordUpdated
This event is fired after a record has been successfully updated
Arguments
control
|
object
|
Reference to DbNetEdit control
|
args
|
object
|
Contains the following properties
updated
|
object
|
Values for the record that was updated.
|
message
|
string
|
Message displayed to user to confirm updating of record
|
|
Run Sample
onRecordValidate
This event is fired in the edit dialog just before the edit is applied. Setting the cancel property on the args parameter causes validation to fail and the update is suppressed. 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 using the parameters property.
Arguments
control
|
object
|
Reference to DbNetEdit control
|
args
|
object
|
Contains the following properties
parameters
|
object
|
Values to be applied to the database. Property names correspond to the table column names.
|
currentRecord
|
object
|
Values for the current record (update only). Property names correspond to the table column names.
|
cancel
|
boolean
|
Set to true if validation fails
|
message
|
string
|
Message to be displayed for failed validation
|
columnToHighlight
|
string
|
The name of the column to highlight if cancel is set to true
|
|
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 DbNetEdit control
|
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
Arguments
control
|
object
|
Reference to DbNetEdit control
|
args
|
object
|
Contains the following properties
message
|
string
|
Message to be displayed when a duplicate entry is encountred
|
|
Run Sample
onValidationFailed
This event is fired when server-side validation prior to update fails for example in the validation of dates and number.
Arguments
control
|
object
|
Reference to DbNetEdit control
|
args
|
object
|
Contains the following properties
columnName
|
string
|
The name of the column that failed validation
|
message
|
string
|
Message to be displayed for failed validation
|
|
|