I have following Editable grid with 3 records:

Using following code in JS, the getRows() always returns an empty collection.
But when I use the getTotalRecordCount() method instead, it is able to return the value "3".

It is unclear for me, why getRows() always return an empty collection ?.
The code:
function loadValue(executionContext) {
var formContext = executionContext.getFormContext();
var gridContext = formContext.getControl("nf_royalty_template_grid");
var gridOC = gridContext.getGrid();
var totalGridRows = gridOC.getTotalRecordCount();
var allRows = gridOC.getRows();
allRows.forEach(function (row, i) {
var gridColumns = row.data.entity.attributes;
gridColumns.forEach(function (column, j) {
var atrName = column.getName();
var atrValue = column.getValue();
console.log(atrName+":"+atrValue);
});
});
}
Debugging in JS
