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.

How can I update the rendered HTML for a node, I don't care about export

See original GitHub issue

this is what I tried:

    var id = '1';
    var node = editor.drawflow.drawflow.Home.data[id];
    node.html = '<div>HELLO WORLD</div>';
    editor.updateNodeDataFromId(id, {});

I was hoping to update the HTML visible, but it doesn’t work. This is read-only HTML and no input or textarea is involved, so df-name won’t work. I know how to update the data, but here I want the HTML to “update”.

my use case is there is a separate edit popup, and after closing that, I want the respective node to “redraw”.

is there a way to get the HTML DOM reference of a node ? I can then set the innerHTML directly

any suggestions would be appreciated !

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
jerosolercommented, Jul 16, 2021

Hello @shubhambattoo

You have to update the json as well.

editor.drawflow.drawflow.Home.data[5].html = "...."

View: https://github.com/jerosoler/Drawflow/issues/40

2reactions
SamuraiDantecommented, May 14, 2021

If I understand you correctly then this would be one way I think: var t = document.querySelector(".drawflow-node[id='node-1'] .drawflow_content_node");

Read more comments on GitHub >

github_iconTop Results From Across the Web

Render HTML file in Node.js and Express.js framework
In this short tutorial, I am going to explain to you how to render HTML files in a custom NodeJS and ExpressJS Server....
Read more >
Render basic HTML view? - Stack Overflow
ejs will tell the view system to require('ejs') , the module being loaded must export the method exports.render(str, options) to comply with Express,...
Read more >
Upgrade your Node app: From CommonJS to ES Modules
1) Prepare your code · 2) Update the package.json · 3) Convert all imports and exports · 4) Fix imports and exports ·...
Read more >
Advanced Features: Static HTML Export - Next.js
Export your Next.js app to static HTML, and run it standalone without the need of a Node.js server.
Read more >
Understanding Modules and Import and Export Statements in ...
Rendered HTML with the values 10 and 5 and the results of the ... update your functions.js file to be a module and...
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