简体   繁体   English

以kendo ui网格弹出形式启用禁用控件

[英]Enable Disable Controls in kendo ui grid popup form

I use a grid with popup editor for insert and edit grid rows. 我使用带有弹出式编辑器的网格来插入和编辑网格行。 in template I use radio button group 在模板中,我使用单选按钮组

and the properties defined in viewmodel var viewModel = kendo.observable({ ChequeNaghdiChange:false, ChequeReturnedChange:false ........ 以及在viewmodel中定义的属性var viewModel = kendo.observable({ChequeNaghdiChange:false,ChequeReturnedChange:false ........

the NRDisabled is used for disable and enable control and its work perfectly out of popup by simple set true or false property viewModel.set("ChequeNaghdiChange",false); NRDisabled用于禁用和启用控件,并且通过简单设置true或false属性viewModel.set(“ ChequeNaghdiChange”,false)可以完美地使弹出菜单弹出窗口。 kendo.data.binders.NRDisabled = kendo.data.Binder.extend({ kendo.data.binders.NRDisabled = kendo.data.Binder.extend({

    refresh: function () {
        if (this.bindings.NRDisabled.get()) {
            this.element.setAttribute("disabled", "disabled");
        } else {
            this.element.removeAttribute("disabled");
        }
    }
});

It's seems property binding have some problem in kendo. 似乎属性绑定在剑道中存在一些问题。 Best Regards Amir 最好的问候阿米尔

I can say that I enable and disable controls in the popup a different way, I attach an event to the grids edit event as follows. 我可以说我以不同的方式启用和禁用弹出窗口中的控件,我将事件附加到网格编辑事件,如下所示。

.Events(events => events.Edit("onOrderDesignGridEdit"))

Then in the edit function I setup the controls that I want enabled or disabled using the model. 然后在编辑功能中,设置要使用模型启用或禁用的控件。

function onOrderDesignGridEdit(e, a) {
    var model = e.model;
    var overrideTotal = model.OverrideTotal;
    var totalEditor = $("#Total").data("kendoNumericTextBox");
    totalEditor.enable(overrideTotal);            
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM