Event error on EditorTemplate

2 posts, 0 answers
  1. Xavier
    Xavier avatar
    28 posts
    Member since:
    Dec 2010

    Posted 11 Nov 2015 Link to this post

    We need to reference to #JustNum, but we don’t find anyway to do it.

    @using SGIRO2014.Models;
    @model object
    <script type="text/javascript">
        function ChangeDocType(e) {
            $("#JustNum").prop("disabled", (this.value() == @((short)documentType.FI)));
    @(Html.Kendo().DropDownListFor(m => m)
        .HtmlAttributes(new { style = "width:100px" })
        .OptionLabel("-please select-")
        .BindTo((SelectList)ViewData[ViewData.TemplateInfo.GetFullHtmlFieldName("") + "_Data"])
        .Events(e => e.Change("ChangeDocType"))      
    @Html.Kendo().TextBoxFor(m => m).Name("DocNum").HtmlAttributes(new { style = "width:100px" })
    @Html.Kendo().TextBoxFor(m => m).Name("JustNum").HtmlAttributes(new { style = "width:40px", maxlength = "2" })



    Thanks in advance



    Xavier de la Rubia.

  2. Boyan Dimitrov
    Boyan Dimitrov avatar
    2035 posts

    Posted 13 Nov 2015 Link to this post

    Hello Xavier,


    The suggested way would be to access the element using jQuery as provided in the code snippet. Is there any error thrown using this approach? Could you please specify what is the problem with this code? 


    Boyan Dimitrov
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top