Do you want to: Ask a how-to question
Question : so the how -to question is regarding how to enable the track changes option becoz by default the track changes is set to " OFF for me and everyone" I want to change it to “ON for me and everyone” using code but not able to do it. the appoach i am using is :
I enabled the basic flag in the editor config to suggest that Track Changes should be enabled:
editorConfig: {
…
customization: {
features: {
trackChanges: true
}
},
…
}
However, I realized this alone doesn’t always enable it immediately for everyone in collaborative mode.
To guarantee the setting takes effect and persists for all users, I used the executeMethod()
API call inside the onDocumentReady
event. This explicitly enables track changes after the document is fully loaded:
onDocumentReady: () => {
let attempts = 0;
const maxAttempts = 10;
const interval = setInterval(() => {
attempts++;
if (createEditor && createEditor.executeMethod) {
createEditor.executeMethod(
'SetTrackRevisions',
[{ value: true, userAll: true }],
(error, result) => {
console.log('Track Changes command result:', { error, result });
}
);
clearInterval(interval);
} else if (attempts >= maxAttempts) {
clearInterval(interval);
}
}, 300);
This ensures Track Changes is **enforced programmatically**, not just suggested via the config.
---
I include the full config (including the `trackChanges` setting and user info) in a JWT for secure ONLYOFFICE initialization:
const token = jwt.sign(config, jwtSecret);
config.token = token;
this is the approach I used but this approach is not working as the document opens with track changes as " OFF for me and everyone " .