This is a migrated thread and some comments may be shown as answers.

Event error on EditorTemplate

1 Answer 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Xavier
Top achievements
Rank 1
Xavier asked on 11 Nov 2015, 02:44 PM
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.

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 13 Nov 2015, 09:58 AM

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
Tags
Grid
Asked by
Xavier
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or