Akshatha
Akshatha

Reputation: 319

Changing the color of particular words in Textareafield in Sencha Touch

I want to change the font color of the misspelled words in a Textareafield in Sencha Touch2. I have the array of misspelled words. This is the textareafield.

           {
                xtype:'textareafield',
                label:'Note',
                id:'txt',
                scroll:'vertical',

            },

MisspeltArr will have the wrongly spelt words.

                    var misspeltArr =[];
                    for(i = 0;i<txtArr.length;i++){
                        var spellCheck = dictionary.check(txtArr[i]);
                        console.log("spellCheck : "+spellCheck);
                        if(spellCheck == false){
                            misspeltArr.push(txtArr[i]);
                        }
                    }

Say i have typed the below text in the textareafield,

   Thisss is a mobile application screennn

Now in txt I have the text entered

  var txt = Ext.getCmp('txt').getValue();

I want to change the color or underline the wrong words - Thisss and screennn (words in the array) in the textareafield. I have achieved spell check and all I want to do is Highlighting the wrong words. Any help is appreciated.

Upvotes: 0

Views: 313

Answers (1)

user2523666
user2523666

Reputation:

it seems you have to use something more advanced than textarea. Something such as iframe may do the job

Upvotes: 1

Related Questions