Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
141306 | Dec 5,2018 11:13 AM UTC | Dec 14,2018 10:24 AM UTC | Angular - EJ 2 | 8 |
![]() |
Tags: Diagram |
To create HTML element (button): The below div should be defined before diagram div.
|
<div id='button_div' style="height:100%;width:100%;border:none; background-color:white;"><img src="./app/diagram/diagram/Nodes_1.png" width="100%;height:50px"/></div> |
Angular : To get the button and show as content of the Node |
ngAfterViewInit(): void {
let node: NodeModel = this.diagram.nodes[6];
// ‘button_div’ id of div which want to show as content of node.
node.shape = { type: 'HTML', content: document.getElementById('button_div') };
this.diagram.dataBind();
}
|
// A connector is created and stored in connectors array.
let connector: ConnectorModel = {
id: 'connector1',
sourcePoint: {
x: 300,
y: 100
},
targetPoint: {
x: 400,
y: 300
},
type: 'Orthogonal',
//Sets the annotation for the node
annotations: [{
// Sets the template for a node
template: '<div><input type="button" value="Submit"></div>'
}]
};
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.