• Anand Kumar 289
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
How to, Javascript Library in Salesforce Lightning Component?

I want make Draw Flow Chart in Lightning Component, (just draw)

I found this : https://gojs.net/latest/samples/flowchart.html 

I want apply Library in Lightning Component


I made component, and Component Code is  : 
 
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" > 
<aura:handler name="init" value="{!this}" action="{!c.doInit}" /> 
<ltng:require scripts="{!join($Resource.Tree + '/release/go.js', $Resource.Tree + '/assets/js/goSamples.js')}"/> </aura:component>

Controller Code is : 
 
({  
    init: function() {
        if (window.goSamples) goSamples();  // init for these samples -- you don't need to call this
        var ab = go.GraphObject.make;  // for conciseness in defining templates
        
        myDiagram =
            ab(go.Diagram, 'myDiagramDiv',  // must name or refer to the DIV HTML element
              {
                  initialContentAlignment: go.Spot.Center,
                  allowDrop: true,  // must be true to accept drops from the Palette
                  'LinkDrawn': showLinkLabel,  // this DiagramEvent listener is defined below
                  'LinkRelinked': showLinkLabel,
                  scrollsPageOnFocus: false,
                  'undoManager.isEnabled': true  // enable undo & redo
              })
        
        // when the document is modified, add a "*" to the title and enable the "Save" button
        myDiagram.addDiagramListener('Modified', function(e) {
            var button = document.getElementById('SaveButton');
            if (button) button.disabled = !myDiagram.isModified;
            var idx = document.title.indexOf('*');
            if (myDiagram.isModified) {
                if (idx < 0) document.title += '*';
            } else {
                if (idx >= 0) document.title = document.title.substr(0, idx);
            }
        }
	}
})



does not saved.... error

How can I do?​

plz
Help me