Mohd Taufeeque

Mohd Taufeeque

  • NA
  • 56
  • 20.2k

Kendo Diagram will not Displying untill we press f12/inspect

Dec 13 2019 1:12 AM
I have a div in html file as.
  1. <div id="center-pane" class="col-sm-10">    
  2.        <div>    
  3.              <div id="d1" style="height: 400px;">    
  4.              </div>    
  5.        </div>    
  6. </div>   

from this html i am calling a function which have a js code to bind the kendo diagram with div 'd1'.

Here is my js code.

  1. diagram = $("#d1").kendoDiagram({  
  2.             dataSource: {  
  3.                 data: [{  
  4.                     items: [{}, {}]  
  5.                 }],  
  6.                 schema: {  
  7.                     model: {  
  8.                         children: "items"  
  9.                     }  
  10.                 }  
  11.              },  
  12.             shapeDefaults: {  
  13.                 width: 80,  
  14.                 height: 80,              
  15.                 type: "image",  
  16.                 source: "https://demos.telerik.com/kendo-ui/html5-dashboard-sample-app/Content/Products/4.jpg",                
  17.                 content: {  
  18.                     text: "shape",  
  19.                 },                      
  20.              },               
  21.             layout: {  
  22.                 type: "tree"  
  23.             },  
  24.             connectionDefaults: {  
  25.                 content: {  
  26.                     color: "green",  
  27.                     fontFamily: "Segoe UI",  
  28.                     fontSize: 16,  
  29.                     fontStyle: "italic",  
  30.                     fontWeight: 200,  
  31.                     template: "#: dataItem.label #"  
  32.                 }  
  33.             },  
  34. }).getKendoDiagram();  

I will call the js function which consist of code to bind diagram with div tag, it will get called and after execution the disgram will not appear, to see the diagram I have to press the F12 button or have to zoom-in/zoom-out the browser page.

What i found that the diagram is getting bind to that div tag but that entire div tag is not displaying, sibling of d1 tag will be visible.

  1. var somevar = $("#d1").html();  
  2.         alert(somevar);  
The above alert box will display the diagram content even though if i will not press the F12 button, it means that the diagram is getting bind to that div but div is not appearing. If i remove the code for binding diagram and call the function then whatever the contents are there in that div are visible if and only if i will comment that code for binding diagram.
 
Thank You.

Answers (1)