PDA

View Full Version : Ext js 4 : How to monitor cursor postion in textfield or textareafield?



chandran09
22 Oct 2011, 12:50 AM
Hi,
I have form which contains one combobox and one textareafield. What i want to do is that, insert a new string in the textareafield at the current cursor position along with the previous texts typed into it, only on the combobox 'select' event occurs. Please help me by providing the code

skirtle
24 Oct 2011, 11:08 AM
I don't believe there's a built-in method to get information about the current caret position or the current selection. If I were you I'd write one using Google searches with the selectText() method for inspiration:

http://docs.sencha.com/ext-js/4-0/source/Text.html#Ext-form-field-Text-method-selectText