3.2.0

Can I put a Javascript function in the Array?

When the data gets put into the array I want to be able to call a javascript function on the click event, is this possible? i.e.

var myData = [
["<a href='#' onclick='runJava('test');'>Click Me</a>"]
]
Tom Hughes
March 14,
Yes, that should work, but you should be careful with nested quotes -

var myData = [
["<a href='#' onclick='runJava(\"test\");'>Click Me</a>"]
];


function runJava(s){
alert(s);
}

var obj = new AW.UI.Grid;
obj.setCellText(myData);
obj.setColumnCount(1);
obj.setRowCount(1);
document.write(obj);
Alex (ActiveWidgets)
March 14,

This topic is archived.

See also:


Back to support forum