Kendo UI Grid Conditional editing

后端 未结 1 773
心在旅途
心在旅途 2020-12-20 05:30

I would like to disable DiscountPercentageMRC/NRC/Usage columns for certain CatalogProductId\'s. Please find below javascript for the grid. Any help would be greatly appreci

相关标签:
1条回答
  • 2020-12-20 06:20

    You would use the Edit event to enable/disable cells. I created a working example here: http://jsfiddle.net/Eh8GL/151/

    function OnEdit(e) {
        // Make sure it's not a new entry
        if (!e.model.isNew()) {
            var catalogproductid =  e.container.find("input[name=CatalogProductId]").data("kendoNumericTextBox").value();
    
            // Disable DiscountPercentageMRC if catalog productid = 100
            if (catalogproductid == 100) {
                var disableField = e.container.find("input[name=DiscountPercentageMRC]").data("kendoNumericTextBox");
                disableField.enable(false);
            }
        }
    }
    
    0 讨论(0)
提交回复
热议问题