Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tableHook not triggered when modal opens #249

Open
samy-mssi opened this issue Feb 2, 2024 · 0 comments
Open

tableHook not triggered when modal opens #249

samy-mssi opened this issue Feb 2, 2024 · 0 comments

Comments

@samy-mssi
Copy link

Hi, I'm trying to warn user that his data is not valid, using the results of my backend (like a reference that doesn't exist).

So I am trying to use the tableHook like this :

        tableHook={(data, addError) => {
          // For the moment, I try to add error on the first row
          addError(0, 'reference', {
            message: "this ref doesn't exist",
            level: 'error',
          });
          // Transformation
          return [...data];
        }}

and I open RSI with this prop :

        initialStepState={{
          type: StepType.validateData,
          data: [
            {
              reference: 'CLIENT_12',
              docNumber: 'DOC_CLIENT_100_1000',
            },
          ],
        }}

The readme says "tableHook - runs at the start and on any change. Runs on all rows. Very expensive, but can change rows that depend on other rows."
But I have to edit the cell to see the error.. Am I using it wrong ?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant