如何在Extjs 3.4网格中选择文本字段值

时间:2014-08-25 09:17:34

标签: javascript extjs

如何在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, "");
                    }

                },

1 个答案:

答案 0 :(得分:0)

将此功能添加到功能有助于:

$("input[type=text]").focus(function() { $(this).select(); });