PDA

View Full Version : grid column renderer - 'onclick' not working



bohemian
11 Jun 2010, 12:32 AM
Hello,

I want to have a button in the grid cell, so I define the column rednerer function which returns this:

'<input type="button" id="Button" onclick=fun() style="width: 16px; height: 16px;"/>'I define function fun earlier as, for example:

var fun = function(){
Ext.Msg.alert("OK");
} But it doesn't work. After clicking the button nothing happens. If I, for example change the above to this:

'<input type="button" id="Button" onclick=Ext.Msg.alert("OK") style="width: 16px; height: 16px;"/>'then it works - alert window shows up.
What I am doing wrong? Is it possible to have custom function as onclick within rendering meta data?

mitchellsimoens
11 Jun 2010, 6:34 AM
Stop using onClick.


Ext.get("Button").on("click", fun);