Highlight part of a text in an extjs textarea -



Highlight part of a text in an extjs textarea -

i need highlight part of text in textarea. have seen done jquery can't utilize jquery because app i'm working on uses extjs(the textarea little part of app). link jquery sample: http://www.strangeplanet.fr/work/jquery-highlighttextarea/ i'm using extjs 2.3.0

message extjs textarea, i'm trying highlight text in.

var message = new ext.form.textarea({ hidelabel: true, id: 'smshl', name : 'smshl', emptytext: 'enter message here', anchor: '90%', allowblank: false, style:'overflow:hidden;style:margin:15px;', height: 90, minlength: 1, minlengthtext: 'you cannot send blank text', maxlength: userobj.smslength, maxlengthtext: 'sorry, maximum length of message exceeded', preventscrollbars: true, enablekeyevents: true, listeners:{ keyup: function() { this.highlighttextarea({ words: ["first word","another word"] }); } } })

i figured out, had create code posted in question work replace this.highlighttextarea jquery('#'+this.getid()).highlighttextarea

so code becomes:

var message = new ext.form.textarea({ hidelabel: true, id: 'smshl', name : 'smshl', emptytext: 'enter message here', anchor: '90%', allowblank: false, style:'overflow:hidden;style:margin:15px;', height: 90, minlength: 1, minlengthtext: 'you cannot send blank text', maxlength: userobj.smslength, maxlengthtext: 'sorry, maximum length of message exceeded', preventscrollbars: true, enablekeyevents: true, listeners:{ keyup: function() { jquery('#'+this.getid()).highlighttextarea.highlighttextarea({ words: ["first word","another word"] }); } } })

extjs textarea extjs2

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -