Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

221
Views
¿Cómo deshabilitar el botón en KO JS después de que ocurra algún evento?

Estoy tratando de habilitar el botón deshabilitado después de cargar una tabla en la página.

 self.uploadPdfButtonIsEnabled = false; self.pricingTableRenderedHandler = function (data, stateName) { self.uploadPdfButtonIsEnabled = true; //some other irrelevant logic }

archivo .cshtml

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

Como resultado, solo deshabilito este botón y no está habilitado. Intenté depurar y se ingresó pricingTableRenderedHandler , uploadPdfButtonIsEnabled se vuelve verdadero pero el botón aún está deshabilitado

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Debe usar un observable para que el enlace knockout pueda actualizarse automáticamente:

 // 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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!