PDA

View Full Version : Select Text after inserting a new Line in Grid



Solitaer
25 Jun 2015, 10:18 PM
Hi,

i have build a grid with Grideditor. A Button "New" makes new Line and Set Text to an Editor Textfield. I will focus this field and select Text to directly Overwrite this text.

Here is the Code from the Button:



store.insert(0, rec);edit.startEdit(0, 0);editor=edit.getEditor();editor.items.items[0].selectText();

This Code works and the Text is Selected, but only for a second then the editor deselect the Text.

Any idea?

Pls Help

suzuki1100nz
25 Jun 2015, 10:29 PM
Hi,

Id say the cell editor component is getting a focus without selectOnFocus set.
Try

edit.getCmp().selectOnFocus = true;
edit.getCmp().focus(true);

Solitaer
25 Jun 2015, 10:38 PM
No, this dosent work:focusElDom.select is not a function

suzuki1100nz
25 Jun 2015, 10:48 PM
Post all your code please - particularly your store, and grid configuration