0
votes

I am trying to set selected records in apex Interactive Grid following documentation API documentation but it does not work.

I have an array of records and when I am trying to set selected records using

apex.region("grid").widget().interactiveGrid("setSelectedRecords", records);

or

grid.setSelectedRecords(records);

when I check it via console the output is like below but the rows are not selected (selection is empty as I would pass the empty array.

console output image

I am using APEX 19.2, anyone faced a similar issue? Any suggestions?

1
What is the contents of the variable records in your situation? Can you show the content?Giliam
@Giliam I have tried different ways, one of them was to first use let grid = apex.region("grid").widget().interactiveGrid("getViews").grid.model.getRecord([1]) and set the grid with apex.region("grid").widget().interactiveGrid("setSelectedRecords", [model]); but it didn't worked. My record is as below: record structurewiktusser
John Snyders has a detailed blog where this is covered hardlikesoftware.com/weblog/2017/02/20/… Look for "Widget Methods"Giliam
or another informative blog about these content is github.com/mgoricki/orclapex-ig-cheat-sheetGiliam

1 Answers

0
votes

Try this:

apex.region("gridId").widget().interactiveGrid("getViews","grid").setSelectedRecords(records, true);

Perhaps must be the record between '[]' example:

var record = apex.region("gridId").widget().interactiveGrid("getViews", "grid").model.getRecord("4551");

apex.region("gridId").widget().interactiveGrid("getViews", "grid").setSelectedRecords([record],true);