You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm a frontend beginner and also new to Univer. I'm exploring whether Univer's features can meet my needs. I want to prevent users from adding or deleting columns in a worksheet. From Univer's documentation (https://docs.univer.ai/zh-CN/guides/sheets/features/core/permission), I see there are two approaches: using API calls or executing commands. I’m building a React app and initializing it within useEffect. Below is my code,
For the first approach (API calls), the examples use await, but since useEffect doesn’t support async directly, I tried using .then().
I registered events inside this block, but they don’t seem to trigger. After calling addWorksheetBasePermission, a lock icon appears on the worksheet tab (indicating protection), and the worksheet background changes to a slashed pattern. However, I can still insert/delete rows and columns.
The second approach (commands) behaves similarly, but I’m unsure if I implemented it correctly. Could you help me identify where the issue might be? Thank you!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I'm a frontend beginner and also new to Univer. I'm exploring whether Univer's features can meet my needs. I want to prevent users from adding or deleting columns in a worksheet. From Univer's documentation (https://docs.univer.ai/zh-CN/guides/sheets/features/core/permission), I see there are two approaches: using API calls or executing commands. I’m building a React app and initializing it within useEffect. Below is my code,
For the first approach (API calls), the examples use await, but since useEffect doesn’t support async directly, I tried using .then().
I registered events inside this block, but they don’t seem to trigger. After calling addWorksheetBasePermission, a lock icon appears on the worksheet tab (indicating protection), and the worksheet background changes to a slashed pattern. However, I can still insert/delete rows and columns.
The second approach (commands) behaves similarly, but I’m unsure if I implemented it correctly. Could you help me identify where the issue might be? Thank you!
Beta Was this translation helpful? Give feedback.
All reactions