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

[Solved] edit template dropdowns and datepicker not working in popup edittemplate

1 Answer 128 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Michael
Top achievements
Rank 1
Michael asked on 18 Apr 2011, 01:06 PM
I know it's a long heading...

Im guessing the facft that neither the dropdownlists nor the datepicker are working in my popup editor template (ajaxbinding) is because maybe there missing javascript files??

It seems odd as a grid in another tab on the same page, behaves fine, with dropdownlists created similarly.

the popup edittemplate is:
@model WAC_MVC.ViewModels.MemberViewModelSimple
 
<script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
 
@using (Html.BeginForm()) {
     
    @Html.ValidationSummary(true)
    <fieldset>
 
        <legend>Enter New Member Details</legend>
 
        @Html.HiddenFor(model => model.mMemberID)
 
        <div class="editor-label">
            @Html.LabelFor(model => model.mFName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.mFName)
            @Html.ValidationMessageFor(model => model.mFName)
        </div>
 
        <div class="editor-label">
            @Html.LabelFor(model => model.MembershipID)
        </div>
        <div class="editor-field">
            @(Html.Telerik().ComboBoxFor(model => model.MembershipID)
            .BindTo(ViewBag.Memberships as SelectList))
            @Html.ValidationMessageFor(model => model.MembershipID)
        </div>
 
        <div class="editor-label">
            @Html.LabelFor(model => model.GroupID)
        </div>
        <div class="editor-field">
            @( Html.Telerik().ComboBoxFor(m => m.GroupID)
                .BindTo(ViewBag.Groups as SelectList))
            @Html.ValidationMessageFor(model => model.GroupID)
        </div>
 
        <div class="editor-label">
            @Html.LabelFor(model => model.mDOB)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.mDOB)
            @Html.ValidationMessageFor(model => model.mDOB)
        </div>
                
    </fieldset>
}


Do i need to include the extra javascript? for this popup alone?

if so is it simply?

@Html.Telerik().ScriptRegistrar().DefaultGroup(group => group.Add("telerik.common.min.js").Add("telerik.list.min.js").Add("telerik.calendar.min.js").Add("telerik.datepicker.min.js").Add("telerik.combobox.min.js"))

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 18 Apr 2011, 01:24 PM
Hi Michael,

 Normally you shouldn't need to include any JavaScript files manually unless there is some ajax load on demand involved. If this is the case you can inspect the Required JavaScript files help topic and include those files in your view or master page file.

If you are using only the combobox and datepicker then the last statement should suffice. If you are loading other Telerik Extensions with ajax (or there is a component such as a tabstrip which loads them) then you need to include their JavaScript files as well.

Regards,
Atanas Korchev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Michael
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or