ASPxClientCardView.FocusedCardChanged Event
Fires in response to changing card focus.
Declaration
FocusedCardChanged: ASPxClientEvent<ASPxClientCardViewFocusEventHandler<ASPxClientCardView>>
Event Data
The FocusedCardChanged event's data class is ASPxClientCardViewFocusEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
isChangedOnServer | Gets whether card focusing has been changed on the server. |
processOnServer | Specifies whether or not to process the event on the server. Inherited from ASPxClientProcessingModeEventArgs. |
Remarks
The FocusedCardChanged event is raised when an end-user moves focus from one card to another. The focused card’s index is returned by the ASPxClientCardView.GetFocusedCardIndex method.
The focused card feature is enabled if the ASPxCardViewBehaviorSettings.AllowFocusedCard property is set to true
.
Example
Handle the ASPxClientCardView.FocusedCardChanged
event to call the OnFocusedCardChanged() function. This function queries the server to return the employee’s details. The returned array is passed to the OnGetRowValues() function that specifies values for corresponding HTML elements.
The image below shows the result:
function OnFocusedCardChanged() {
cardView.GetCardValues(cardView.GetFocusedCardIndex(), 'FirstName;LastName;HomePhone;Title;Notes', OnGetCardValues);
}
function OnGetCardValues(values) {
var editors = [FirstName, LastName, Phone, Title, Notes];
for (var i = 0; i < editors.length; i++) {
var editor = editors[i];
editor.SetValue(values[i]);
}
}