I have an interactive grid with a radio group (values Y,N, NA) and need to use this value to show/hide an associated column in grid upon selection or when grid initially displays. I am running a dynamic action on the change event of the radio group that does the following:
// Get the interactive grid widget
var ig$ = apex.region("questiongrid").widget();
// Get the grid view and model
var gridView = ig$.interactiveGrid("getViews", "grid");
var model = gridView.model;
// Get the selected records (returns an array)
var selectedRecords = gridView.getSelectedRecords();
if (selectedRecords.length > 0) {
// Get the first selected record
var currentRecord = selectedRecords[0];
// Retrieve the value from the radio group column
var radioValue = model.getValue(currentRecord, "ANSWER");
// Display the value in an alert
alert("Selected Radio Group Value: " + radioValue);
} else {
alert("No record is selected");
}
My problem is this code is returning an OBJECT and not the actual value of the radio group.. Can anyone suggest a modification to help? I know the code does NOT show/hide columns, it will as soon as I determine the error in how to get the radiogroup value..
Thank you!
Tony Miller
White Rock, NM