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;
}