如何在组合框中获取所选项目的datavaluefield? [英] How to get datavaluefield of selected item in combobox ?

查看:80
本文介绍了如何在组合框中获取所选项目的datavaluefield?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Kendo组合框不能获得项目的选定值



我尝试过的方法:



Kendo combobox can't get selected value of item

What I have tried:

@(Html.Kendo().ComboBox()
            .Name("ddl" + @Model.objDllColl[i].MCLELDescription.Split(' ')   [0].ToString())  //@Model.objDllColl[i].MCLELDescription.Split(' ')[0].ToString()
                    .HtmlAttributes(new { style = "width: 200px;" })
                                    .Events(e =>{                                                                       e.Select("filterProducts1");//.Open("onOpen");                                                              }) 
            .DataValueField("MCLECECode")
            .DataTextField("MCLELDescription")
				 .DataSource(source =>{
                                                                               source.Read(read =>                                                                              {                                                                                   read.Action("_Cluster", "Cluster", new { area = "" })                                                                            .Data("filterProducts");})                                                                               .ServerFiltering(true);})                                        
                    .AutoBind(true)
                    .ToClientTemplate()
        )

 function filterProducts1(e) {
         debugger
         alert('ertera')
         var CEDCode = this.dataItem(e.item.index()).ValueField; //this.dataItem(e.item.index()).ValueField
         alert(CEDCode)
        
     }

推荐答案

尝试使用并简单化。我希望有效。

Try using and making it simple. I hope that works.
var combobox =


(#COMBOBOXNAME)。data(kendoComboBox);
combobox.value();
combobox.text()
("#COMBOBOXNAME").data("kendoComboBox"); combobox.value(); combobox.text()


这篇关于如何在组合框中获取所选项目的datavaluefield?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆