- Home
- Forum
- ASP.NET MVC
- Need Help on Diagram Type
Need Help on Diagram Type
Attachment: ModelImage_e929c802.zip
Hi Shyam,
Thanks again. This swimlane and group node exactly suits my need. Can you please share the sample code which populates from code behind?
Thanks,
Karthick
Thank you Shyam for the code and the video sample. I also tried to create a diagram without the group based on the samples given. Now I am stuck with one issue on this. I get scroll bar If I add more horizontal swimlanes or if I add more phases. I tried adjusting the width and height of diagram_section, control_section styles. Also, adjusted the diagram height, width, scroll settings in code behind but still getting the vertical scroll bar. I faced issues with the width as well but i tried adjusting the offset values and it worked. Can you please hep on this?
- By default, if an diagram content exceeds the diagram viewport width/height, the scrollbar appears. So you need to scroll it to view the content outside the viewport.
- If you need to fit the diagram content within the viewport, you can use diagram fitToPage method.
- Also when the diagram size exceeds the browser window size, the native scroll bar occurs. At that time, you can use fitToPage method.
- Please refer to the code example below in which we have used fitToPage method in the nodeCollectionChange event. So when you drag the lane and drop it onto the diagram, the nodeCollectionChange event triggers and in this event we have called fitToPage method to fit the diagram within the viewport only if the swimlane size exceeds the viewport. At initial rendering if the lane size exceeds the viewport, you can call fitToPage method in the create event. Also we have shown how to update the diagram size at runtime.
Hi Shyam, Thanks for your help. I have the below code but getting the vertical scroll bar next to the diagram if the diagram size exceeds the browser page limit. Is it possible to avoid that since the page doesn't look nice if there are 2 scroll bars. Also, Is it possible to bind this diagram like treemap or chart, so that i cannot edit text, delete or rotate boxes?
function create(args) {
var diagram = $("#DiagramContent").ejDiagram("instance");
diagram.fitToPage();
}
|
Query |
Response |
|
Thanks for your help. I have the below code but getting the vertical scroll bar next to the diagram if the diagram size exceeds the browser page limit. Is it possible to avoid that since the page doesn't look nice if there are 2 scroll bars. |
We have modified the sample in which we have rendered the diagram scrollbars alone. Please refer to the sample below.
|
|
Also, Is it possible to bind this diagram like treemap or chart, so that i cannot edit text, delete or rotate boxes? |
Could you please confirm us whether you need to bind chart/treemap control in our diagram and could not be edited at runtime? If yes, please use Html node to achieve your requirement. please refer to the code example below. Also please refer to the sample attached above.
Code example:
<script id="Htmltemplate" type="text/x-jsrender">
<div id="container" style="width: 200px; height: 200px;"></div>
</script>
HtmlNode node = new HtmlNode();
node.Name = "html";
node.Width = 200;
node.Height = 200;
node.TemplateId = "Htmltemplate";
node.Constraints = NodeConstraints.PointerEvents;
node.OffsetX = 200;
node.OffsetY = 200;
diagram.Nodes.Add(node);
|
Hi Shyam,
I was not clear with my last question regarding binding the chart. sorry. I dont need to bind treemap or chart in the diagram. Right now, If i bind the diagram and run the application, I am able to edit the shape text or delete a shape etc from the browser. I dont want to do that. My diagram should not be editable in the browser.
Thanks,
Karthick
Thanks Shyam. Below line resolved my issue. Thanks a lot for your help.
model.Constraints = DiagramConstraints.Default & ~DiagramConstraints.PageEditable;
Thanks,
Karthick
- 12 Replies
- 2 Participants
-
KA Karthick
- Aug 30, 2017 12:55 PM UTC
- Sep 14, 2017 03:52 AM UTC