欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Kendo UI dropdownlist 获取选中数据

程序员文章站 2022-06-12 08:18:45
...

下拉框 

<input id="Exp_Position" inputRequired="required" onblur="inputRequiredChange(this)"
                                               data-role="dropdownlist"
                                               data-text-field="Exp_PositionName"
                                               data-value-field="Exp_PositionID"
                                               data-bind="value:expenseApply.Exp_PositionID, source:PositionResource,events:{change:PositionChange}">
                                        <span class='k-widget k-tooltip k-tooltip-validation field-validation-error k-required' 

数据绑定

PositionResource: new kendo.data.DataSource({
            transport: {
                read: {
                    url: "/BaseData/PositionList"
                }
            },
            requestEnd: function (res) {
            }
        }),

 

当下拉框数据改变,获取选中的下拉框值 

        //职务改变
        PositionChange: function (res) {
            var senectData = res.sender.dataItem(res.sender.select());
            expenseApplyCreateViewModel.expenseApply.set("Exp_PositionID", senectData.Exp_PositionID);
            expenseApplyCreateViewModel.expenseApply.set("Exp_PositionName", senectData.Exp_PositionName);
        },