How to attach multiple actions to a popup template in 4.0

933
1
09-13-2016 05:23 AM
roberttilson
New Contributor II

I am trying to attach multiple actions to the popup template using ESRI js api 4.0 it does't throw any errors into the console but doesn't display the action either, I can attach one action to a template and it works just fine I'm following this reference guide.

Code: https://jsbin.com/moqajuwugu/edit?html,output

 // Add this action to the popup so it is always available in this view  
var measureThisAction = {    
  title: "Measure Length",    
  id: "measure-this",    
  image: "Measure_Distance16.png"  
};  
var someotherAction = {    
  title: "Someother Action",    
  id: "other-action-this",    
  image: "Measure_Distance16.png"  
};   
var template = { // autocasts as new PopupTemplate()    
  title: "Trail run",    
  content: "{name}",    
  actions: [measureThisAction]  };  
  template.actions.push(someotherAction);

Any help would be greatly appreciated.

0 Kudos
1 Reply
thejuskambi
Occasional Contributor III

You could add multiple actions like this.

var template = { // autocasts as new PopupTemplate()    
  title: "Trail run",    
  content: "{name}",    
  actions: [measureThisAction, someotherAction]  
};  
0 Kudos