Page Index Toggle Pages: 1 [2]  Send TopicPrint
Hot Topic (More than 10 Replies) MindFusion JS diagram version 2.1 “Node Clicked Event” on the mobile devices not firing (Read 11491 times)
Slavcho
YaBB Moderator
*****
Online


tech.support

Posts: 3378
Joined: Oct 19th, 2005
Re: MindFusion JS diagram version 2.1 “Node Clicked Event” on the mobile devices not firing
Reply #15 - Jun 9th, 2016 at 8:39am
Print Post  
FYI we have uploaded a patched 2.6 build at http://clientsarea.eu/ , you shouldn't need the above work-around with it.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Ranadheer Reddy
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 9
Joined: Jun 2nd, 2016
Re: MindFusion JS diagram version 2.1 “Node Clicked Event” on the mobile devices not firing
Reply #16 - Jun 9th, 2016 at 8:57am
Print Post  
Hi,

Thanks for the reply.

I have tried using JQuery mode in my project, but still the issue exists. Sad

In the below way i have set the JQuery mode in my html.

Code (HTML)
Select All
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
	<title>MindFusion.Diagramming for JavaScript: Tutorial 1</title>
</head>

<body>
    <!-- The Diagram component is bound to the canvas element below -->
    <div style="width:100%; height:1100px; border: 5px solid; border-color: green; overflow: auto;">
        <canvas id="diagram" style="width:1800px; height:800px; cursor: default;">
            This page requires a browser that supports HTML 5 Canvas element.
        </canvas>
    </div>

    <script type="text/javascript">
        MindFusionImpl = "JQuery";
    </script>

    <script src="jquery-2.1.4.min.js" type="text/javascript"></script>
	<script src="MicrosoftAjax.js" type="text/javascript"></script>
	<script src="MindFusion.Diagramming.js" type="text/javascript"></script>
	<script src="Tutorial1.js" type="text/javascript"></script>
</body>

</html 



I have also Overrided the emulateMouse in my js file as suggested below

Code (Javascript)
Select All
Diagram.prototype.emulateMouse = function (e)
{
    var touches = e.touches;
    var mouseEvent =
    {
        button: 0,
        clientX: touches[0].clientX,
        clientY: touches[0].clientY
    };
    return mouseEvent;
}; 



Do i need to do any more anychanges to my code..??

Please find attached Project where i have made Jquery mode as default.

Note: We are Using Diagram of 2.1 version

Thanks
Ranadheer
  

MindFusionSampleProject__3_.zip (Attachment deleted)
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Online


tech.support

Posts: 3378
Joined: Oct 19th, 2005
Re: MindFusion JS diagram version 2.1 “Node Clicked Event” on the mobile devices not firing
Reply #17 - Jun 9th, 2016 at 10:34am
Print Post  
Hi,

There's some scale applied to the canvas because of the style.width and style.height assignments here -

Code
Select All
<canvas id="diagram" style="width:1800px; height:800px; cursor: default;"> 



The component later sets element's width and height properties (*not* through element.style) from its resizetoFitItems method; that stretches the canvas and you see mismatch between actual graphic coordinates we use to draw and what's actually rendered.

Removing those fixes it for me -
Code
Select All
<canvas id="diagram" style="cursor: default;"> 



Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Online


tech.support

Posts: 3378
Joined: Oct 19th, 2005
Re: MindFusion JS diagram version 2.1 “Node Clicked Event” on the mobile devices not firing
Reply #18 - Jun 9th, 2016 at 10:53am
Print Post  
Now I see your code still tries to load json using MS Ajax and Array.forEach enumeration but you get a blank canvas. I think jQuery adds its own Array.forEach extension with a different signature and breaks your existing code. Try using ArrayList.forEach instead as in our code from http://mindfusion.eu/_samples/testtouch/Tutorial1.html

It also replaces MS JSON loading code with jQuery equivalent.

Regards,
Slavcho
Mindfusion
« Last Edit: Jun 9th, 2016 at 4:29pm by Slavcho »  
Back to top
 
IP Logged
 
Ranadheer Reddy
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 9
Joined: Jun 2nd, 2016
Re: MindFusion JS diagram version 2.1 “Node Clicked Event” on the mobile devices not firing
Reply #19 - Jun 10th, 2016 at 11:59am
Print Post  
Hi,

So, u meant to say that no where we need to use MS Ajax and we need to use only JQuery mode...??

Thanks
Ranadheer
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Online


tech.support

Posts: 3378
Joined: Oct 19th, 2005
Re: MindFusion JS diagram version 2.1 “Node Clicked Event” on the mobile devices not firing
Reply #20 - Jun 10th, 2016 at 12:13pm
Print Post  
I guess you can keep using MS Ajax if you want, just fix the Array.forEach error then.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint