How to Get Dropdown's Selected Item's text in Kendo UI?

后端 未结 7 808
遥遥无期
遥遥无期 2021-02-05 02:05

I am using Kendo UI Controls. I want to get the selected text of the dropdown list in jquery. I have used this syntax :

 $(\"#ddl\").data(\"kendoDropDownList\")         


        
相关标签:
7条回答
  • 2021-02-05 02:52

    For DropDownLists, you include a DisplayText and a Value. DisplayText being what the user selects and the Value being what is used in the back-end.

    Example: You have a database that stores Contact information and your DisplayText would be the Contacts Name and the Value would be the Primary Keys ID field for that particular row in the database.

    ID - 1 Name - John Smith

    $("#ddl").data("kendoDropDownList").dataItem().DisplayText = John Smith
    $("#ddl").data("kendoDropDownList").dataItem().Value = 1
    

    This is what I was looking to do, I hope this is the answer you were also looking for.

    0 讨论(0)
提交回复
热议问题