Hi Charles,
Here's a JavaScript function that is adapted from the code mentioned in the following forum thread:
http://www.activewidgets.com/javascript.forum.1394.39/textbox-template-edit-on-double.html
It takes a row index and puts the focus on the first cell of the row for editing. Not sure why it doesn't work unless the last line is done twice. HTH.
function activateEdit(rownum) {
var editor = new Active.HTML.INPUT;
editor.setClass("templates", "input");
editor.setAttribute("type", "text");
editor.setEvent("onblur", function() {
var value = editor.element().value;
template.setItemProperty("text", value);
template.refresh();
template = null;
});
template = obj.getRowTemplate(rownum).getItemTemplate(0);
template.element().innerHTML = editor;
editor.element().focus();
editor.element().focus();
}
D. Cooke
When I return focus to a cell sometimes it puts the cursor at the beginning of the cell and sometimes after the last character that was entered in the Text Box... Is there a way to control where the cursor will be placed in the Text Box when focus is returned?? I would prefer to have the cursor positioned at the end of the last character that was entered...
This topic is archived.