简体   繁体   中英

ExtJs - How to style textarea text?

I got a textarea in ExtJs 4.1 and want to modify the font family and size.

   style    : 'font-family: courier new, font-size: 8px'
   style    : {
     'fontFamily'   : 'courier new',
     'fontSize'     : '8px'
   }

I also tried like this:

oTextarea.el.applyStyles({
            'font-family'  : 'verdana',
            'font-size'    : '8px'
         });

You should be using fieldStyle of the config for TextArea field component:

fieldStyle: {
     'fontFamily'   : 'courier new',
     'fontSize'     : '8px'
   }

Or if the field already exists, use the setFieldStyle function of the field component.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM