Kendo Grid: how to get the selected item from a Combobox cell template when using with Angular

前端 未结 2 422
感情败类
感情败类 2021-01-24 13:11

I have a Kendo grid which I am using within Angular, and have a field with a combo box, that has the editor set to the following function...

 function comboCellT         


        
2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-24 13:29

    I think you can simply add a change handler to the editor and set it from there:

    function comboCellTemplate(container, options) {
        var input = $('')
        input.appendTo(container)
        var combobox = input.kendoComboBox({
            autoBind: true,
            filter: "contains",
            placeholder: "select...",
            suggest: true,
            dataTextField: "description",
            dataValueField: "code",
            dataSource: data,
            change: function () {
                options.model.set(options.field, this.dataItem());
            }
        });
    }
    

提交回复
热议问题