Skip to content

DataSourceApi.insertData promise is resolved too early #190

@roblotter

Description

@roblotter

After inserting data into the Grid (using the code below) and awaiting the result of the promise, I do not see the newly added row in the row info array.

const dataSourceApi = apis.dataSourceApi!;

dataSourceApi
  .insertData(createRow(), { position: "start" })
  .then((result) => {
      const rowInfo = dataSourceApi.getRowInfoByPrimaryKey(99999);
      console.dir(rowInfo);
      const rowInfoArray = dataSourceApi.getRowInfoArray();
      console.dir(rowInfoArray);
  });

However, if I wait a bit then call dataSourceApi.getRowInfoArray(), it returns the results with the newly inserted row as expected. It seems that the promise returns before the data gets added.

Metadata

Metadata

Assignees

Labels

Type: bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions