I have a Dojo Datagrid with one of the columns being rendered as a textbox by a formatter function. When I click on the rendered textbox to enter some value, the cursor appears in the textbox and focus is immediately lost (i.e, the cursor disappears - typing does not produce anything). I have to click once more on the textbox for the focus to set - only then can I enter values.
Is there any way to set the focus on the first click itself?
Here is the code:
<table dojoType="dojox.grid.DataGrid" store="selectedItemsStore" class="resultsGridClass" jsid="selecteditems">
<thead>
<tr>
<th field="field1" formatter="renderTextBox" width="20%">Field 1</th>
</tr>
</thead>
</table>
And here is the formatter function:
function renderTextBox(value, rowIndex) {
var htmlString = "<input type='text' name= 'exp' />";
return htmlString;
}
From stackoverflow
-
Try setting editable and alwaysEditing attributes to true:
<th alwaysEditing="true" editable="true" field="field1" formatter="renderTextBox" width="20%" >Field 1</th>
Shivasubramanian A : Nope. Does not work.ivalkeen : You can try to repeat behavior from this test page (when Toggle dSingleClickEdit is pressed): http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/grid/tests/test_edit.html
0 comments:
Post a Comment