我有一個Dojo Datagrid,其中一列通過格式化函數呈現爲文本框。當我點擊渲染文本框輸入某個值時,光標會出現在文本框中,焦點會立即丟失(即光標消失 - 輸入不會產生任何內容)。我必須再次點擊文本框才能設置焦點 - 只有這樣才能輸入值。無法將焦點設置爲dojo數據網格中的文本框
有什麼辦法可以將重點放在第一次點擊本身上嗎?
下面是代碼:
<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>
這裏是格式化功能:
function renderTextBox(value, rowIndex) {
var htmlString = "<input type='text' name= 'exp' />";
return htmlString;
}
不知道這是否與http://bugs.dojotoolkit.org/ticket/9827有關 - 在該工單中有一個支持嵌入文本輸入方式的參考 – peller 2009-10-12 16:13:01
這裏也有同樣的問題。有人知道解決方案嗎? – 2013-11-19 12:44:35