Skip to content

DataSourceApi.insertData promise is resolved too early #190

Closed

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.

Activity

  1. added this to the 1.3.24 milestone on Jul 14, 2023
  2. self-assigned this
    on Jul 14, 2023
  3. added
    Type: bug
    on Jul 14, 2023
  4. roblotter commented on Jul 14, 2023

    @roblotter
    ContributorAuthor

    This is included in version 2.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type: bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions