Skip to main content

ASPxClientCardView.GetCardValues(visibleIndex, fieldNames, onCallback) Method

Returns the values of the specified data source fields within the specified card.

Declaration

GetCardValues(
    visibleIndex: number,
    fieldNames: string,
    onCallback: ASPxClientCardViewValuesCallback
): void

Parameters

Name Type Description
visibleIndex number

The card’s visible index.

fieldNames string

The names of data source fields separated via a semicolon, whose values within the specified card are returned.

onCallback ASPxClientCardViewValuesCallback

An ASPxClientCardViewValuesCallback object that represents the JavaScript function which receives the list of card values as a parameter.

Remarks

An example can be found in the Focusing Online Demo.

Note

If you pass a single field as a fieldNames parameter to the GetCardValues method, the function passed as the onCallback parameter receives a single value as a parameter, rather than a list of card values.

In this case, your function should work with a single value instead of the list of values. A working example is shown in the code sample below:

// function is called on changing focused card
function OnFocusedCardChanged() {
    // Query the server for the "EmployeeID" field from the focused card
    // The single value will be returned to the OnGetCardValues() function     
    cardView.GetCardValues(cardView.GetFocusedCardIndex(), 'EmployeeID', OnGetCardValues);
}
// Value contains the "EmployeeID" field value returned from the server, not the list of values
function OnGetCardValues(Value) {
    // Right code
    alert(Value);
    // This code will cause an error
    // alert(Value[0]);
}
See Also