3.2.0

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 ?

Example:

var gridcols = ["Ticker", "Company Name", "Market Cap.", "$ Sales", "Employees"];
var numrows=gridrows.length;
var numcols=gridcols.length;
var objgrid = new Active.Controls.Grid;
objgrid.setRowCount(numrows);
objgrid.setColumnCount(numcols);
objgrid.setDataText(function(i, j){return gridrows[i][j]});
objgrid.setColumnText(function(i){return gridcols[i]});
objgrid.setRowHeaderWidth("28px");
objgrid.setColumnHeaderHeight("20px");
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);
document.write(objgrid);

P.S
It looks like that the last column (empty) are not working with objgrid.getTemplate("row", 0).setStyle
December 16,
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
Alex (ActiveWidgets)
December 16,
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.


December 17,

This topic is archived.

See also:


Back to support forum