Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

127
Vistas
Set Field label as HTML String in Ext JS

I have below html string which needs to be set as a fieldLabel of textfield as HTML.

'<p><strong><span style="background-color: rgb(210, 213, 216);">Test</span></strong></p>'

But its not getting converted by compiler in HTML and it shows the string as it is.

I have converted that string to HTML tag using below code.

function decodeHtml(html) {
  var txt = document.createElement("textarea");
  txt.innerHTML = html;
  return txt.value;
}

After conversion, HTML tags are displayed as label instead of the html output. whereas if I directly use those tags as a field label, it works fine. Can anyone suggest how can we display the html string as a field label, Any hints will be really appreciated. Below image shows the outputs for different scenarios.

enter image description here

Sample sencha fiddle can be found here

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Try using the encodeHtml property set to false

items: [{
            xtype: 'textfield',
            fieldLabel: '<p><strong><span style="background-color: rgb(210, 213, 216);">Test</span></strong></p>',
            encodeHtml: false, // using this seems to work********
            labelSeparator: '',
        }]
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda