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)));
        }
    </script>
     
    @(Html.Kendo().DropDownListFor(m => m)
        .HtmlAttributes(new { style = "width:100px" })
        .ValuePrimitive(true)
        .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
    Admin
    Boyan Dimitrov avatar
    1746 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? 

     

    Regards,
    Boyan Dimitrov
    Telerik
    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
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top