Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

DropDownList Select event get dataitem

$
0
0

We recently updated to the latest kendoUI 2015.1.429 and noticed a weird issue on the dropdownlist select event.  Here is the code:  

@(Html.Kendo().DropDownListFor(m => m.Deficiency.correctionId)
   .DataTextField("Description")
   .DataValueField("CorrectionId")
   .HtmlAttributes(new { id = "Deficiency_correctionId" })
   .OptionLabel("-- Select Correction --")
   .Events(e => e.Select("onDeficiencyCorrectionDDLSelect").DataBound("CorrectionDDLDataBound"))
   .BindTo(Model.Corrections))
 
function onDeficiencyCorrectionDDLSelect(e) {
        var correction = this.dataItem(e.item.index());
...

When I set an OptionLabel and get the dataItem using e.item.index() in the select event, I get the previous data item in the list.  However, if I removed the index() and just use this.dataItem(e.item); then it works fine.  Also, in cases where I don't use the OptionLabel and in KendoComboBoxes are OK.  Has this changed since the last update?  I ask because we are doing this in many places and also noticed this usage on other posts in this forum as well. 

 Thanks,
Quynh


Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>