I have 'jquery-1.12.4.js', 'jquery-ui-1.12.0.js' and my css in my shared layout.
I'm using jquery dialog to popup.
and I call my partial view and load it.
$element.dialog({
autoOpen: false,
width: wSize,
height: hSize,
resizable: true,
draggable: true,
title: dTitle,
closeOnEscape: true,
open: function (event, ui) {
$(this).load(url);
},
close: function () {
$(this).css("display", "none");
}
});
$("#elementID").dialog("open");
In my server side..
public ActionResult stats(string sDate, string eDate, string Mode, int Id)
{
...
try
{
...
Model stats = GetDatabase
ViewData["StartDate"] = sDate;
ViewData["EndDate"] = eDate;
}
catch(Exception ex)
{
...
}
return View(stats);
}
In my partial view.. (no refer jquery, jquery-ui script)
<script type="text/javascript">
$(function () {
$('#txtStartDate').datepicker({
dateFormat: 'yy-mm-dd',
prevText: ..,
nextText: ..,
monthNames: ..,
monthNamesShort: ..,
dayNames: ...
dayNamesShort: ...,
dayNamesMin: ...,
showMonthAfterYear: ..,
yearSuffix: ..
});
});
<input type="text" id="txtStartDate" value="@startDate" class="form-control" />
In that case, I can see hasDatePicker class in developer tool but calendar doesn't appear and It's nothing inside. Even more, I can't see any error message in my console.
In chrome developer tool ...
<div id="ui-datepicker-div" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>
My main page, I have exactly same datepicker but it works fine.
In chrome developer tool...
<input type="text" id="current_date1" name="current_date1" class="form-control date-picker hasDatepicker">
How can I solve the problem?