Results 1 to 5 of 5

Thread: How to set value in TextArea with different styles?

  1. #1
    Sencha User
    Join Date
    Jul 2009
    Posts
    86

    Default How to set value in TextArea with different styles?

    Hi everyone

    I've got a question about how to set value in TextArea with different styles??
    Because I set the value from a store but I can't, this is my code

    Code:
       StoreText.load(function(){        
          StoreText.each(function(rec){       
                if(str_nombreSeccion == rec.get('nombreSeccion')){
                    str_pasos += rec.get('descripPaso')+'\n';
                }else{
                    str_pasos += rec.get('nombreSeccion')+'\n';
                }
                str_nombreSeccion = rec.get('nombreSeccion');
            });
            Ext.getCmp('myTextArea').setValue(str_pasos);
        });
    I try with

    Code:
       StoreText.load(function(){        
          StoreText.each(function(rec){       
                if(str_nombreSeccion == rec.get('nombreSeccion')){
                    str_pasos += rec.get('descripPaso')+'\n';
                }else{
                    str_pasos += rec.get('nombreSeccion').bold()+'\n';
                }
                str_nombreSeccion = rec.get('nombreSeccion');
            });
            Ext.getCmp('myTextArea').setValue(str_pasos);
        });
    or

    Code:
       StoreText.load(function(){        
          StoreText.each(function(rec){       
                if(str_nombreSeccion == rec.get('nombreSeccion')){
                    str_pasos += rec.get('descripPaso')+'\n';
                }else{
                    str_pasos += '<b>'+rec.get('nombreSeccion')+'</b>'+'\n';
                }
                str_nombreSeccion = rec.get('nombreSeccion');
            });
            Ext.getCmp('myTextArea').setValue(str_pasos);
        });
    But it doesn't work, can help me??

  2. #2
    Sencha User
    Join Date
    Jul 2009
    Posts
    86

    Default

    some ideas?

  3. #3
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    Are you wanting to have a one textarea containing multiple styles at the same time or to keep changing styles?

  4. #4
    Sencha User
    Join Date
    Jul 2009
    Posts
    86

    Default

    yep, with multiple styles at the same time:
    example:

    title 1
    line 1.1
    line 1.2
    line 1.3

    title 2
    line 2.1
    line 2.2
    line 2.3

  5. #5
    Sencha Premium Member
    Join Date
    Jun 2015
    Posts
    6

    Default

    Use an htmleditor if you want to style your text is different ways

Similar Threads

  1. [FIXED] Scrollbar in textarea disappear when the textarea is invalid
    By ber00000 in forum Sencha GXT Bugs
    Replies: 1
    Last Post: 8 May 2013, 7:46 AM
  2. Replies: 2
    Last Post: 9 Dec 2012, 8:22 PM
  3. Replies: 5
    Last Post: 3 Sep 2012, 7:03 AM
  4. Replies: 5
    Last Post: 8 Feb 2012, 3:01 AM
  5. Ext.form.TextArea displays 2 different styles
    By rpetras in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 23 Mar 2009, 5:54 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •