如何在beforeedit侦听器函数中选择Ext JS 3.4 grid的文本字段值?
'beforeedit' : function(object) {
var rec = gridTilit.store.getAt(object.row);
var colIndex = object.column;
var rowIndex = object.row;
var cm = Ext.getCmp('grid-tilit').getColumnModel();
var valCol = cm.getColumnAt(colIndex);
var count = gridTilit.getStore().getTotalCount();
var cellXtype = valCol.getEditor().getXType();
colname = object.field;
if (cellXtype=="textfield") {
//function to select signle textfield
// cell value to selected must be executed here
} else {
rec.set(colname, "");
}
},
答案 0 :(得分:0)
将此功能添加到功能有助于:
$("input[type=text]").focus(function() { $(this).select(); });