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

223
Vistas
How to disable button in KO JS after some event happens?

I'm trying to enable disabled button after I load a table on the page.

self.uploadPdfButtonIsEnabled = false;
self.pricingTableRenderedHandler = function (data, stateName) {
        self.uploadPdfButtonIsEnabled = true;

        //some other irrelevant logic
}

.cshtml file

 <button class="button button--primary" id="uploadPdfsButton" data-bind="click: $root.openPdfUpload, enable: uploadPdfButtonIsEnabled">
      <span class="button__text">Upload PDF</span>
 </button>

As a result, I only get this button disabled and it is not enabled. Tried to debug and the pricingTableRenderedHandler is entered, uploadPdfButtonIsEnabled becomes true but the button is still disabled

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

0

You have to use an observable for the knockout binding to be able to update automatically:

// Pass the initial value: `false`
self.uploadPdfButtonIsEnabled = ko.observable(false);
self.pricingTableRenderedHandler = function (data, stateName) {
  // Update by calling with the new value: `true`
  self.uploadPdfButtonIsEnabled(true);
}
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