rendering error: using DatePickerControl "DateFieldFor " in partial view

  1. #1

    rendering error: using DatePickerControl "DateFieldFor " in partial view

    I have a view "called:edit" that contain a partial view "called:CreateDialog" as following
    Edit View
    
            <div id="divCreate" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="padding-top:50px">
                <div class=" modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header alert alert-warning">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">?</button>
                            <h4 class="modal-title" id="myModalLabel">Create Action</h4>
                        </div>
                        <div class="modal-body">
                            @Html.Action("CreateDialog", "DiscussionAction", new { id = Model.DiscussionID })
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
                            <button id="btnClearConditions" type="button" class="btn btn-primary" onclick="SaveAction('frmCreateAction')">Save</button>
                        </div>
                    </div>
                    <!-- /.modal-content -->
                </div>
                <!-- /.modal-dialog -->
            </div>
    CreateDialog partial view

    <div class="form-group">
                <div class="input-group">
                    @Html.LabelFor(model => model.Description, new { @class = "input-group-addon label-width" })
                    @Html.TextAreaFor(model => model.Description, new { @class = "form-control ctrl-width" })
                    @Html.ValidationMessageFor(model => model.Description)
                </div>
            </div>
    
    <div class="form-group">
                <div class="input-group">
                    @Html.LabelFor(model => model.DueDate, new { @class = "input-group-addon label-width" })
                    @Html.X().DateFieldFor(model => model.DueDate).ID("dtDueDate").Icon(Icon.DateMagnify).Editable(true).Format("MM/dd/yyyy").HideLabel(true).Cls("input-group-addon label-width")
                    @Html.ValidationMessageFor(model => model.DueDate)
                </div>
            </div>
    the partial view has "DateFieldFor" component that render datepicker .

    when I request the partial view, it is rendered fine. but when request the main view "Edit" , it yhrow js exception and page doesn't render correctly

    JS Exception
    
    Message: 'X' is undefined
    Line: 2026
    Char: 13
    Code: 0
    URI: http://localhost:53620/extnet/extnet-all-debug-js/ext.axd?v=25065
    
    
    Ext.override(Ext.Component, {
        initComponent : function () {
            this.callParent(arguments);
    
            if (!Ext.isEmpty(this.contextMenuId, false)) {
                this.on("render", function () {
                    this.mon(this.el, "contextmenu", function (e, t) {
                        var menu = Ext.menu.MenuMgr.get(this.contextMenuId);
                        menu.contextEvent = { e : e, t : t };
                        e.stopEvent();
                        e.preventDefault();
                        menu.showAt(e.getXY());
                    }, this);            
                }, this, { single : true });    
            }
        
            if (this.iconCls) {
                X.net.RM.setIconCls(this, "iconCls");
            }
  2. #2
    Hi @adabo,

    Hard to say what is going wrong. If you can provide a full test case to reproduce the problem, we would be happy to investigate.

Similar Threads

  1. Replies: 0
    Last Post: Mar 13, 2014, 4:34 AM
  2. Replies: 7
    Last Post: Sep 06, 2013, 3:31 AM
  3. Replies: 6
    Last Post: May 31, 2013, 3:04 AM
  4. Replies: 5
    Last Post: May 02, 2012, 5:37 PM
  5. Replies: 4
    Last Post: Oct 11, 2011, 2:42 AM

Posting Permissions