:: Forum >>

disable/enable row.setEvent

It looks if i use row.setEvent that no other onmouseover or onmouseout event will be work. I like to use a hidden div with some form data.
If a row will be selected with a rowclick, the hidden div becomes visible and for this case i have to stop the onmouseover or onmouseout event for the grid.
How can i disable/enable the row.setEvent ?


var gridcols = ["Ticker", "Company Name", "Market Cap.", "$ Sales", "Employees"];
var numrows=gridrows.length;
var numcols=gridcols.length;
var objgrid = new Active.Controls.Grid;
objgrid.setDataText(function(i, j){return gridrows[i][j]});
objgrid.setColumnText(function(i){return gridcols[i]});
var row = new Active.Templates.Row;
row.setEvent("onmouseover", "mouseover(this, 'active-row-highlight')");
row.setEvent("onmouseout", "mouseout(this, 'active-row-highlight')");
objgrid.setTemplate("row", row);
function myColor(){var value = this.getProperty("item/index");return (value & 1) ? "#FAFAFA" : "white";}
objgrid.getTemplate("row", 0).setStyle("background-color", myColor);
var datatrans = function(){
// call a subform div
// ?? how to disable row.setEvent
objgrid.setAction("selectionChanged", datatrans);

It looks like that the last column (empty) are not working with objgrid.getTemplate("row", 0).setStyle
Tuesday, December 16, 2003
obj.setEvent method creates event handler for a given object/template only. If this affects something else - then it's a bug and I'll try to correct it. Can you tell me what exactly doesn't work in your subform div?

Alex (ActiveWidgets)
Tuesday, December 16, 2003
Mea clupa... was error by design.
All works, tested in the subform div with:

<td class="label" onmousemove="this.style.background='red';" onmouseout="this.style.background=''blue;" >

But i need a possibility to switch the objgrid.setAction("selectionChanged", datatrans); when the subform div is active.

On way is to redirect :objgrid.setAction("selectionChanged", wait4end);
if the subform is active.

Wednesday, December 17, 2003

This topic is archived.

Back to support forum

Forum search