• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

155
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

almost 3 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); }
almost 3 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 Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error