How to move it?
async function addSticky() {
myItem = await miro.board.createStickyNote({
content: 'Web SDK test!',
});
}
async function moveRight() {
myItem.x += 10;
}
is it possible to move throught WEB SDK?
How to move it?
async function addSticky() {
myItem = await miro.board.createStickyNote({
content: 'Web SDK test!',
});
}
async function moveRight() {
myItem.x += 10;
}
is it possible to move throught WEB SDK?
Hey
Good question! You can update an item’s position (x, y) using the Web SDK’s sync() method.
First, you’ll set the new values of the x, y coordinates, and then you’ll call sync() to make the updated position effective on the board.
Here is an example for creating a sticky note and then updating it’s position:
const stickyNote = await miro.board.createStickyNote({
content: 'Hello'
});
// First, you change the values of the properties you want to update.
stickyNote.content = 'Updated sticky note';
stickyNote.style.fillColor = 'light_blue';
stickyNote.x = 200;
stickyNote.y = -100;
// Second, you sync the item to make the changes effective.
await stickyNote.sync();
You can even test this out with our built in sandbox here:
https://developers.miro.com/docs/task-2-update-an-items-properties-with-sync
Hope it helps!
Will
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.