obj.setEvent("ondblclick", switchToEditMode)
- but when I change the value of one Select Box and then proceed to double click on another cell that contains a Select Box, the selected option/value appears as the previously changed Select Box's value.
function switchToEditMode()
{
template = this;
template.element().style.padding = 0;
template.element().innerHTML = editor;
var originalText = template.getItemProperty("value");
editor.element().focus();
}
var editor = new Active.HTML.DIV;
editor.setId("DivMultiSelect");
editor.setTag("select");
editor.setClass("templates", "input");
editor.setAttribute("type", "text");
editor.setEvent("onblur", function(event) { this.switchToTextMode( event ); } );
editor.setContent( "options", function()
{
var text = template.getItemProperty("text");
var column = template.getColumnProperty("index");
var foundMe = false;
var inputOptions = obj._options;
var optionsHTML = new Array();
for( i=0; i< inputOptions.length; i++ )
{
var oTag = new Active.System.HTML();
var val = inputOptions[i][0];
var txt = inputOptions[i][1];
if(column == inputOptions[i][2]) {
oTag = new Active.System.HTML();
oTag.setTag("option");
oTag.setAttribute( "value", val );
oTag.setContent("text",inputOptions[i][1]);
if ( text==txt ){
oTag.setAttribute( "selected","true" );
foundMe = true;
}
optionsHTML.push( oTag );
}
}
if (!foundMe){optionsHTML.push("<option value=\""+text+"\" selected=\"true\">"+text+"</option>");}
return optionsHTML.join("");
});
obj.setDataProperty("text", function(i, j){return myData[i][j]});
obj.getDataText = function(i, j){return myData[i][j]}
obj.setDataText = function(value, i, j){myData[i][j]=value}
This topic is archived.