:: Forum >> Version 2 >>

Can I put a Javascript function in the Array?

More information on this topic is available in the documentation section: /grid.doc.data/.

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
Friday, March 14, 2008
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)
Friday, March 14, 2008



This topic is archived.

Back to /grid.doc.data/

Documentation:

Forum search