AnsweredAssumed Answered

insert HTML code in Object Literals attribute

Question asked by Sara_EL_MALKI on Sep 27, 2017
Latest reply on Sep 27, 2017 by jgrayson-esristaff

Hi guys,

 

I am working on a  dojo Chart, I wanna turn all the X-axis text to buttons, that I can click them later on,

 

var circuits_1_=[];
for (var i = 0, len = FeaturesCC.length; i < len; i++) {
var circuit_1_={};
var FeatureCC = FeaturesCC[i];
id_circuit_array.push(FeatureCC.attributes['objectid']);

//var s = '<button id="myDivButton'+i+'">'+FeatureCC.attributes['layer']+'</button>';
//var x = document.createElement("BUTTON");
//var t = document.createTextNode(""+FeatureCC.attributes['layer']);
//x.appendChild(t);

circuit_1_={value:i+1, text:""+FeatureCC.attributes['layer']};
circuits_1_.push(circuit_1_);
}

I have tried this :

circuit_1_={value:i+1, text:"<button id='smth"+i+"' type='button'>"+FeatureCC.attributes['layer']+"</button>"};

but it doesn't work, HELP me please

Robert Scheitlin, GISP Thomas Solow Rebecca Strauch, GISP

Outcomes