PDA

View Full Version : [CLOSED] CalendarPanel: date picker



supera
May 23, 2012, 1:11 PM
Hi!

CalendarPanel is showing strange behavior.
This behavior occurs in this example too.
http://examples2.ext.net/#/Calendar/Overview/Basic/

To reproduce, follow the steps:
1 - Click in 'Day' button, in CalendarPanel toolbar, to change the viewMode to DayView.
2 - Click in any date, in datepicker, in a week different of the current day. For example, may/08.
3 - Click in 'Week' button, in CalendarPanel toolbar. The week showed is the week of current day, and not the week of may/08.

I think that should be displayed week is the week of may/08 (may/6 to may/12)

Daniil
May 23, 2012, 6:01 PM
Hi,

Well, it's expected behavior for me, because the setStartDate sets up a start date for the current view only.

Please look at the DatePicker listener how you could achieve your requirement.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.NET v2 Example</title>

<script type="text/javascript">
var onSelect = function (picker, date) {
App.CalendarPanel1.setStartDate(date);
App.CalendarPanel1.startDate = date;
};
</script>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:Viewport runat="server" Layout="BorderLayout">
<Items>
<ext:Panel
runat="server"
Width="180"
Region="West">
<Items>
<ext:DatePicker ID="DatePicker1" runat="server">
<Listeners>
<Select Fn="onSelect" />
</Listeners>
</ext:DatePicker>
</Items>
</ext:Panel>
<ext:CalendarPanel ID="CalendarPanel1" runat="server" Region="Center">
<EventStore runat="server" />
</ext:CalendarPanel>
</Items>
</ext:Viewport>
</form>
</body>
</html>

supera
May 25, 2012, 6:33 PM
Hi Daniil!

Works very fine!

Thanks a lot!