search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

DayView change the start date to dynamically get value from calendar control

Asked by Rick
10 years ago.

I need assistance in changing the StartDate value in the daypilotcalendar control from a static entered date to automatically get the value based on the SelectedDate value in Calendar control. Is their a way to do that? Here is the code:

<daypilot:daypilotcalendar id="DayPilotCalendar1" runat="server" OnDayRender="Calendar1_SelectionChanged"
DataEndField="end"
DataStartField="start"
DataTextField="name"
DataValueField="id"
Days="1"
onselectionchanged="DayPilot1_SelectionChanged"
DataSourceID="SqlDataSource1" StartDate="4/10/2014" anyway to change this to use the selected date from calendar control"
></daypilot:daypilotcalendar>

Answer posted by Dan Letecky [DayPilot]
10 years ago.

1. If you want to use <asp:Calendar> control you will need to place both controls inside an UpdatePanel.

In the Calendar.SelectionChanged event handler, call:

DayPilotCalendar1.StartDate = Calendar1.SelectedDate;
DayPilotCalendar1.DataSource = GetYourData();
DayPilotCalendar1.DataBind();
// and update the UpdatePanel with DayPilotCalendar

2. If you don't insist on using the ASP.NET built-in Calendar control you can use DayPilot Navigator. Please see the following tutorial:

http://www.daypilot.org/tutorial-navigator.html

Comment posted by Rick
10 years ago.

Thanks Dan.

Comment posted by Ramesh
10 years ago.

Hi,DayView change the start date to dynamically get value from calendar control. I am using java. Do you have any sample and i want applay tooltip. How can i applay.
<!-- <script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-1.3.2.min.js"></script> -->
<script type="text/javascript" src="<%=request.getContextPath()%>/js/daypilot/common.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/daypilot/calendar.js"></script>
<link type="text/css" href='<%=request.getContextPath()%>/media/layout.css' rel="stylesheet" />

</head>
<style>
#backgroundPopup {

position: fixed;
display:none;
height:100%;
width:100%;
}

#toPopup {
background: none repeat scroll 0 0 #FFFFFF;
border: 4px solid #ccc;
display: none;
font-size: 14px;
left: 80%;
margin-left: -402px;
position: fixed;
top: 50%;
width: 270px;
height:70px;
}

</style>
<style>
body { font-size: 62.5%; }
label, input { display:block; }
input.text { margin-bottom:12px; width:95%; padding: .4em; }
fieldset { padding:0; border:0; margin-top:25px; }
h1 { font-size: 1.2em; margin: .6em 0; }
div#users-contain { width: 350px; margin: 20px 0; }
div#users-contain table { margin: 1em 0; border-collapse: collapse; width: 100%; }
div#users-contain table td, div#users-contain table th { border: 1px solid #eee; padding: .6em 10px; text-align: left; }
.ui-dialog .ui-state-error { padding: .3em; }
.validateTips { border: 1px solid transparent; padding: 0.3em; }
</style>
<script type="text/javascript">
<script type="text/javascript">
var dpc ='';
$(document).ready(function() {
var temp1="";
dpc = $("#dpc").daypilotCalendar({
backendUrl : '${pageContext.request.contextPath}/dpc',
viewType : "Week",
//viewType : "Day",
//viewType : "Resources",
heightSpec : 'BusinessHours',
timeRangeSelectedHandling : 'CallBack',
eventMoveHandling : 'CallBack',
eventResizeHandling : 'CallBack',
timeRangeSelectedHandling : 'JavaScript',
showAllDayEvents : true,
// bubble : new DaypilotCalendar.Bubble({ cssClassPrefix: "bubble_default" } ),
showToolTip : false,
//startAutoRefresh : 'force',
//autoRefreshEnabled : true,
//autoRefreshInterval :10,
//autoRefreshMaxCount :12
onTimeRangeSelected: function(start, end) {
//var name = prompt("New Event Name:", "Ramesh created");
document.getElementById('startDate').value=start;
document.getElementById('endDate').value=end;
$( "#dialog-form" ).dialog( "open" );
//test(start,end);
/* $( "#dialog-form" ).dialog( "open" );
dpc.timeRangeSelectedCallBack(start, end, null, { name: temp1 });
dpc.clearSelection();
*/
},

});

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.