The method addEvent adds events to all grid cells.
event - An object represents event types and corresponding handlers.
var pggrid = new jsgrid(); pggrid.init({ id: "wrp", rows: 5, columns: 12, width: 25, height: 20, gutter: 1, backgroundColor: "#d00000" }); pggrid.addEvent({"click": foo, "mouseover": foo, "mouseout": foo}); function foo(e){ e = (e) ? e : ((window.event) ? window.event : ""); var o = getTargetElement(e); if (e.type == "click"){ alert("OK"); } else if (e.type == "mouseover"){ o.style.backgroundColor = "#eee"; } else o.style.backgroundColor = "#d00000"; }