Jan 12, 2012, 9:21 AM
[CLOSED] Fire event only upon clicking on the arrow on calendar panel
Hi
How do I ensure event only fire upon clicking on the arrows highlighted in red?
I notice the viewChange event was triggered each time I clicked on the arrows and different types of views (day, week, month).
I also notice the viewchange event triggered by calling the databind at the backend, which is not something I would like it happened as this would cause double databind.
I'm doing so because I need to ensure, the data is re-retrieve and refreshed upon clicking on the arrows and different types of view (day, week, month).
How do I ensure event only fire upon clicking on the arrows highlighted in red?
I notice the viewChange event was triggered each time I clicked on the arrows and different types of views (day, week, month).
I also notice the viewchange event triggered by calling the databind at the backend, which is not something I would like it happened as this would cause double databind.
I'm doing so because I need to ensure, the data is re-retrieve and refreshed upon clicking on the arrows and different types of view (day, week, month).
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack AndAlso Not Ext.Net.X.IsAjaxRequest Then
Me.GetDataForCalendar(Now.Date, Now.Date)
End If
End Sub
<DirectMethod([Namespace]:="ESS")> _
Public Sub GetDataForCalendarByDate(ByVal StartDate As DateTime, ByVal EndDate As DateTime)
Me.GetDataForCalendar(StartDate, EndDate)
End Sub
Private Sub GetDataForCalendar(ByVal StartDate As Date, ByVal EndDate As Date)
.....
Me.MyCalendar.DataBind()
End Sub
<script type="text/javascript">
var ESS = {
viewChange: function (p, vw, dateInfo) {
if (dateInfo !== null) {
// will be null when switching to the event edit form, so ignore
this.DatePicker1.setValue(dateInfo.activeDate);
this.updateTitle(dateInfo.viewStart, dateInfo.viewEnd);
// Refresh data
ESS.GetDataForCalendarByDate(dateInfo.viewStart, dateInfo.viewEnd)
}
}
};
</script>
Kindly Advise. Thanks!
Last edited by Daniil; Jan 16, 2012 at 8:12 AM.
Reason: [CLOSED]