Thursday, October 5, 2017

Kendo Grid Inline Edit with Drop Down option disabled

I have a Kendo Grid with inline edit options. I have a dropdown from which user have to select values. I want to disable certain items from the dropdown dynamically. I have to dynamically enable and disable options from dropdown so I store disabled objects in a separate array than source. Here is an example.

columns: [{
            field: "xxxx",
            title: "xxxx",
            template: function (dt) {
                return dt.xxxx;
            },
            editor: function (container, options) {
                $('<input name="' + options.field + '"/>')
                    .appendTo(container)
                    .kendoDropDownList({
                        dataTextField: "textField",
                        dataValueField: "ValueField",
                        dataDisabled:arrayOfObjThatShouldBeDisabled,//Don't work I know
                        dataSource: {
                            data: myDataSource // DYNAMIC SOURCE
                        }
                    });
            }
        }]

Here is a sample from Kendo website.

Another Example

Source: AngularJS



from Angular Questions https://angularquestions.com/2017/10/05/kendo-grid-inline-edit-with-drop-down-option-disabled/
via @lzomedia #developer #freelance #web #lzomedia.com

No comments:

Post a Comment