-
-
Notifications
You must be signed in to change notification settings - Fork 703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
is it possibe to enter Dynamic property names by user #226
Comments
You can use this method to pass new variables to the module. Although it is a bad idea to leave the user, since the user can put blank characters, accents, strange characters ... |
not leaving completely by clicking add button new row will be displayed then they will type what is the property name and value |
Then you will have to use the commented function. |
provide sample html code for 1 row please🙏 |
The example is very simple. In this case it only works with node ID 1 View a simple example: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/gh/jerosoler/Drawflow/dist/drawflow.min.css"
/>
<script src="https://cdn.jsdelivr.net/gh/jerosoler/Drawflow/dist/drawflow.min.js"></script>
<style>
#drawflow {
position: relative;
width: 600px;
height: 600px;
border: 1px solid red;
}
</style>
</head>
<body>
<div id="drawflow"></div>
<button onclick="exportdf()">Export</button>
<script>
var id = document.getElementById("drawflow");
const editor = new Drawflow(id);
editor.reroute = true;
editor.reroute_fix_curvature = true;
editor.start();
const htmltest = `<button onclick="addinput()">+</button>`
editor.addNode('test', 1,1, 50, 100, 'test', {}, htmltest );
function addinput() {
document.querySelector("#node-1 .drawflow_content_node").innerHTML = `<input type="text" df-name>`;
editor.drawflow.drawflow.Home.data[1].html = `<input type="text" df-name>`;
editor.updateNodeDataFromId(1, { name: "hi!!!"});
}
function exportdf() {
console.log(editor.export());
}
</script>
</body>
</html> |
thank you so much But i am trying to keep |
Change 'name' for your variable |
actually my query was when a user click plus button new row have to display with two text inputs one is property and value both should be exported to json |
How to do this for selected nodes |
Use events Or const nodeId = editor.node_selected; |
Any solution to export user edited property name |
i want to keep df-{dynamic property name } entered by user
The text was updated successfully, but these errors were encountered: