3.2.0

Problems to obtain clientX and clientY on the cell ‘indicator’ chunk of code

Hi,

I used the ‘cell- indicator’ chunk of code, with an onmouseover event, which intend to show a small image near by the cell (on each row), but I got some problems to establish the right use on clientX and clientY

obj.onCellIndicatorMouseOver = function(event, col, row){ 
document.getElementById("paso_sensor_dia_hora").style.left = window.event.clientX + 15; 
document.getElementById("paso_sensor_dia_hora").style.top = window.event.clientY - 95; 
document.getElementById("paso_sensor_dia_hora").style.visibility = "visible";
}


This code, work just fine on IE, but not on FF, any idea, obviously is an document object reference problems, an not AW issue, anyway help will be grateful.

saludos, raul
Raul
April 24,
Normally event is passed to the event handler function as a first argument, so maybe it will work if you use event instead of window.event?
Alex (ActiveWidgets)
April 25,
Yes, my first thought, but event is passing a string like

<span id="aw33-cell-4-5" class="aw-item-template aw-templates-text aw-indicator-visible aw-grid-cell aw-column-4 aw-cells-normal" title="" aw="cell"><span id="aw33-cell-4-5-box-ruler" class="aw-item-ruler"></span><span id="aw33-cell-4-5-box-text" class="aw-item-text">TERRA</span><span id="aw33-cell-4-5-box-indicator" class="aw-pass-indicator" onclick="AW(this,event)" onmouseover="AW(this,event)" onmouseout="AW(this,event)"></span></span>

Not the event handler, the first try was simply event.clientX, but I get and error and halt on IE and undefined on FF

Yes, my first thought too, but event is passing a string like

<span id="aw33-cell-4-5" class="aw-item-template aw-templates-text aw-indicator-visible aw-grid-cell aw-column-4 aw-cells-normal" title="" aw="cell"><span id="aw33-cell-4-5-box-ruler" class="aw-item-ruler"></span><span id="aw33-cell-4-5-box-text" class="aw-item-text">TERRA</span><span id="aw33-cell-4-5-box-indicator" class="aw-pass-indicator" onclick="AW(this,event)" onmouseover="AW(this,event)" onmouseout="AW(this,event)"></span></span>

Not the event handler, the first try was simply event.clientX, but I get and error and halt on IE and undefined on FF

I’m stuck here, any clue?
Raul
April 25,
Sorry for the messy duplication on my last post, Alex, do you have any idea on this.
Raul
April 26,
I guess you should pass the native event object when you raise custom event -

...
indicator.setEvent("onmouseover", function(event){
        this.raiseEvent("onCellIndicatorMouseOver", event);
});
...

Alex (ActiveWidgets)
April 26,
Really appreciated Alex, it’s work just fine
Raul
April 26,

This topic is archived.

See also:


Back to support forum