在页面上加载表后,我试图启用禁用的按钮。
self.uploadPdfButtonIsEnabled = false;
self.pricingTableRenderedHandler = function (data, stateName) {
self.uploadPdfButtonIsEnabled = true;
//some other irrelevant logic
}
.cshtml文件
<button class="button button--primary" id="uploadPdfsButton" data-bind="click: $root.openPdfUpload, enable: uploadPdfButtonIsEnabled">
<span class="button__text">Upload PDF</span>
</button>
因此,我只禁用了此按钮,但它未启用。尝试调试并输入了pricingTableRenderedHandler,uploadPdfButtonIsEnabled变为true,但此按钮仍处于禁用状态
1条答案
按热度按时间ccrfmcuu1#
您必须使用可观察项,以使敲除绑定能够自动更新: