Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic 'MindFusion' is undefined - getting my feet wet with Canvas mode (Read 7391 times)
jlj30
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 183
Joined: Sep 4th, 2011
'MindFusion' is undefined - getting my feet wet with Canvas mode
Feb 17th, 2014 at 7:11pm
Print Post  
Hi,

I have taken a copy of the FlowCharter demo page, modified it slightly and included it in my current asp.net application.
When I try and access this page I get the following error:

0x800a1391 - JavaScript runtime error: 'MindFusion' is undefined

Here's my aspx page. The failing line is highlighted:

Code (HTML)
Select All
<%@ Page Title="" Language="C#" MasterPageFile="~/ITO.master" AutoEventWireup="true" CodeFile="P_CFFD_DD_POC.aspx.cs" Inherits="P_CFFD_DD_POC" %>

<%@ Register Assembly="MindFusion.Diagramming.WebForms" Namespace="MindFusion.Diagramming.WebForms" TagPrefix="ndiag" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content id="Content2" contentplaceholderid="ContentPlaceHolder" runat="Server">
    <div style="float: left;">
        <ndiag:ShapeListBox ID="shapeList" runat="server" ClientSideMode="Canvas" DefaultShapeSize="20,20" JsLibraryLocation="~/Js/MindFusion.Diagramming.js"
            Style="width: 140px; height: 400px; background-color: white" ShapeFillColor="WhiteSmoke" BorderColor="Black" IconSize="20,20" />
    </div>
    <div>
        <ndiag:DiagramView runat="server"
            ID="diagramView"
            Style="height: 400px; width: 650px;"
            ClientSideMode="Canvas"
            NodeCreatedScript="onNodeCreated"
            JsLibraryLocation="~/Js/MindFusion.Diagramming.js"
            AllowInplaceEdit="true"
            Diagram-RouteLinks="true" />
    </div>
    <div style="clear:both;">
        <br />
        <asp:Button ID="btnSave" runat="server" OnClick="btnSave_Click"
            Text="Save" Width="111px" />
        <asp:Button ID="btnLoad" runat="server" Style=""
            Text="Load" Width="111px" OnClick="btnLoad_Click" />
        &nbsp;
        <asp:TextBox ID="tbFileName" runat="server">untitled.fc</asp:TextBox>
        <asp:DropDownList ID="listFileNames" runat="server">
        </asp:DropDownList>
    </div>

    <script type="text/javascript">
        var AnchorPattern = MindFusion.Diagramming.AnchorPattern;

        function onNodeCreated(sender, args) {
            var node = args.getNode();
            node.setAnchorPattern(AnchorPattern.decision1In3Out);
            node.setBrush({ type: 'SolidBrush', color: '#B0C4DE' });
        }
    </script>
</asp:Content>

 



Since I'm new to canvas mode, I'm sure I've missed something.

Thanks in advance for helping me get past this Smiley

Jim
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: 'MindFusion' is undefined - getting my feet wet with Canvas mode
Reply #1 - Feb 18th, 2014 at 7:47am
Print Post  
Hi,

Check the generated HTML to see if the resolved diagramming.js URL is in the expected folder. Also try to download it by copying the URL to browser address bar to verify IIS has permissions to the folder.

Note that you must load Microsoft Ajax before diagramming.js; in the samples that's done implicitly by the asp:ScriptManager tag, but you could also load it using a <script src=Microsoft.Ajax.js> tag.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
jlj30
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 183
Joined: Sep 4th, 2011
Re: 'MindFusion' is undefined - getting my feet wet with Canvas mode
Reply #2 - Feb 18th, 2014 at 3:20pm
Print Post  
Hi,

I have added the following to the head of my page:

Code (HTML)
Select All
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
     <script src="MicrosoftAjax.js" type="text/javascript"></script>
     <script src="MindFusion.Diagramming.js" type="text/javascript"></script>
</asp:Content> 



Remember, I'm using a master page.
The result is that I can now run in FireFox and Chrome (I actually placed alerts in the onNodeCreated function and they fire). Plus I now see the anchor handles on the shapes when I hover them.

However, IE is a problem; at least when I emulate IE7 and IE8 from the Developers Tools page. Selecting IE9, 10 or Edge for Document mode works fine.

Here are the error messages for IE7 and IE8:

IE7:
Unhandled exception at line 1, column 1 in http://vs2013-jim/NavviaNewDev/MindFusion.Diagramming.js

0x800a0404 - JavaScript runtime error: Expected identifier, string or number

IE8:
Unhandled exception at line 1, column 243342 in eval code

0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'addEventListener'

Many of our clients are still running IE8, so hopefully you can shed some light on what might be happening.

Thanks

Jim
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: 'MindFusion' is undefined - getting my feet wet with Canvas mode
Reply #3 - Feb 18th, 2014 at 4:12pm
Print Post  
Hi,

Unfortunately earlier IE versions do not support the HTML5 Canvas element; it was first implemented in IE9.

Stoyan
  
Back to top
 
IP Logged
 
jlj30
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 183
Joined: Sep 4th, 2011
Re: 'MindFusion' is undefined - getting my feet wet with Canvas mode
Reply #4 - Feb 18th, 2014 at 4:18pm
Print Post  
Hi,

Ah yes.
Thanks for the prompt reply.
Time for us to get our clients to get current Smiley

Jim
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint