Input template doesn't work with onMouseOver event...
Hi there folks,
i've struggled for days until guess that my grid's onmouseover event was "blocking" the input template. I didn't find any reason for this, maybe the order which dblclick and mouseover events are called... i don't get it for now. I think this two characteristics (onmouseover and input template) should be integrated easily but to me it seems they arent... for sure is something missing me.
Does anyone see the problem here?!
Thanks a bunch!
The input template code:
The script code:
i've struggled for days until guess that my grid's onmouseover event was "blocking" the input template. I didn't find any reason for this, maybe the order which dblclick and mouseover events are called... i don't get it for now. I think this two characteristics (onmouseover and input template) should be integrated easily but to me it seems they arent... for sure is something missing me.
Does anyone see the problem here?!
Thanks a bunch!
The input template code:
My.Templates.Input = Active.Templates.Text.subclass();
My.Templates.Input.create = function()
{
var obj = this.prototype;
var editor = new Active.HTML.INPUT;
editor.setClass("templates", "input");
editor.setAttribute("type", "text");
editor.setAttribute("value", function(){
return template.getItemProperty("text");
});
var template;
function switchToEditMode(){
if (template) {
switchToTextMode()
}
template = this;
//template.element().style.padding = 0;
template.element().className += " active-edit-mode ";
template.element().innerHTML = editor;
editor.element().focus();
editor.setEvent("ondblclick", editor.element().focus());
}
obj.setEvent("ondblclick", switchToEditMode);
function switchToTextMode(){
var value = editor.element().value;
template.setItemProperty("text", value);
template.refresh();
template = null;
}
editor.setEvent("onblur", switchToTextMode);
}
My.Templates.Input.create();
The script code:
var obj = new Active.Controls.Grid;
var template = new My.Templates.Input;
obj.setColumnTemplate(template);
obj.setRowProperty("count", 9);
obj.setColumnProperty("count", 5);
obj.setDataProperty("text", function(i, j){return myData[i][j]});
obj.setColumnProperty("text", function(i){return myColumns[i]});
obj.getDataText = function(i, j){return myData[i][j]};
obj.setDataText = function(value, i, j){myData[i][j] = value};
var row = new Active.Templates.Row;
row.setEvent("onmouseover", "mouseover(this, 'active-row-highlight')");
row.setEvent("onmouseout", "mouseout(this, 'active-row-highlight')");
obj.setRowTemplate(row);
obj.setEvent("onkeydown", null);
obj.getTemplate("top").setEvent("onselectstart", obj.getEvent("onselectstart"));
obj.setEvent("onselectstart", null);
document.write(obj);
Ricardo Guerra
August 9,