question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dynamically update content [question]

See original GitHub issue

Hello, I’ve searched a lot but couldn’t find a way to dynamically update content (previously saved html). What I’ve found, that may be related to what I want, is these two methods editor.syncRegions(regionQuery) stack.replaceRegions(regions), but can’t do anything with it, documentation is so unclear to me.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
anthonyjbcommented, Jun 23, 2016

OK I think I get it 😃 I’m guessing that posts each have a unique ID and that at any one time there’s only one editable region (e.g you can only edit one post at a time).

If you don’t want to stop/start the editor when switching to a different post then my advice would be to do the following:

Replacing the region

  • Use the post ID in the region name to ensure it will be unique, for example <div class="post" data-editable data-name="post-123">
  • When you switch between posts, remove the current editable region and replace it with a new region for the switched to post and ID, so now the editable region might be <div class="post" data-editable data-name="post-124">
  • Call syncRegions against the editor which should then recognize the new region and forget the old one.
0reactions
anthonyjbcommented, Jun 28, 2016

@brunjick OK the setContent is now a method against the Region class and I’ve updated the documentation for syncRegions along the lines of our conversation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can I dynamically update question text based on previous ...
Hey there, I'd like to dynamically update question text (or a simple text field) based on an answer given by the user earlier...
Read more >
Questions With Dynamic Content - GoGuardian
Want to give students an item that asks students to solve a certain problem, but looks different for each student?
Read more >
Provide notification of dynamic changes to content
Where dynamic content is updated either automatically or in response to a user action, make sure that users are notified of this update...
Read more >
Dynamically update webpage with file content - Stack Overflow
Save this question. Show activity on this post. I need a simple solution to dynamically display on a webpage the content of a...
Read more >
Dynamically Change Question Text of the Variable - ServiceNow
Hi, You can create different questions(variables), and control the visibility by UI Policy. Also, the way will be to create a sing variable ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found