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

How to use “onRequestUser” #18

Closed
likedream11 opened this issue Jul 9, 2023 · 2 comments
Closed

How to use “onRequestUser” #18

likedream11 opened this issue Jul 9, 2023 · 2 comments

Comments

@likedream11
Copy link

I didn't find 'events_onRequestUsers'

@likedream11
Copy link
Author

好吧,我依靠示例自己封装了个组件,大家也自己封装吧,

@aleksandrfedorov97
Copy link
Contributor

Hi likedream11, you can pass event to config like so:

var onRequestUsers = function (event) {
    var editor = window.DocEditor.instances[args.id];
    editor.setUsers({
        "c": event.data.c,
        "users": [
            {
                "email": "john@example.com",
                "id": "78e1e841",
                "name": "John Smith"
            },
            {
                "email": "kate@example.com",
                "id": "F89d8069ba2b",
                "name": "Kate Cage"
            }
        ]
    });
  };
   
<DocumentEditor
    config={{
              events: {
                onRequestUsers: onRequestUsers
              }
    }}
        />
      </div>
  )}

Detailed documentation on this method you can find here (https://api.onlyoffice.com/editors/config/events#onRequestUsers)

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

2 participants