Posted 6 September 2022, 11:42 pm EST - Updated 3 October 2022, 12:01 am EST
In the GIF below you will see a collection that is displayed using the TableSheet component. We do not allow a user to add a new record using the feature available in the TableSheet. Instead a user must click the “Add Associate” button which will add a new record to the collection at the server. Once that is done, we execute the following code to refresh the view so that the added record is reflected in the TablSheet display:
export async function SetActiveView(workbookName: string, tableName: string, viewName: string, reload: boolean) {
var spread = GC.Spread.Sheets.findControl(workbookName);
if (spread) {
var sheet: GC.Spread.Sheets.TableSheet.TableSheet = spread.getSheetTab(tableName);
var view = dataViews[viewName];
if (view) {
await view.fetch(reload);
sheet.setDataView(view);
}
}
}
This seems to work, and from the GIF below you will see that a new record appears at the top with the EmplID of “TEMP23”.
However there is also a TableRelationship being used to associate the employee’s “JobCode” with the “Job Title”. The jobcode of the newly added associate is “100100”.
But you will see from the GIF that the jobcode display for that associate is not correct. It is displaying the jobcode for the record below it. And each record is affected. So each record is now showing the jobcode-title that is actually for the row below it.
Once i update a value for any record, the TableRelationship seems to correct itself and all records re-render the JobCode display and it is corrected.
If you watch the GIF carefully you will see how the job code value does not line up with what is being displayed. You will also see how everything corrects itself once I update a single value.
I’ve tried:
-
"
-
“Refreshing Table instead of View”
-
“Refreshing spreadsheet control entirely”
-
“Removing and readding the TableRelationship”
"
Nothing seems to force the “correction” other than updating a record cell value. Is there some method i can invoke manually to achieve this as a workaround?
Hopefully this is enough to identify the problem. I could setup a demo but that would take a decent amount of time to reproduce.