Jun 10, 2011, 8:02 AM
[CLOSED] CalendarPanel: Some question about my customized the <DirectEvents>
Hi,
Because default <ext:EventEditWindow> could not be satisfied with request.
I defined the <DirectEvents> to insert the event parameters to my database .
I know in the "common.js" file, there is some function for the default <ext:EventEditWindow> to add the new event to show in the UI.
Could you help me?
Thanks.
Because default <ext:EventEditWindow> could not be satisfied with request.
I defined the <DirectEvents> to insert the event parameters to my database .
......
<ext:CalendarPanel ID="CalendarPanel1" runat="server" Region="Center" ActiveIndex="1">
<GroupStore ID="GroupStore1" runat="server">
<Groups>
<ext:Group CalendarId="1" Title="Home" />
<ext:Group CalendarId="2" Title="Work" />
<ext:Group CalendarId="3" Title="School" />
<ext:Group CalendarId="4" Title="Other" />
</Groups>
</GroupStore>
<DirectEvents>
<DayClick OnEvent="Calendar_DayClick" Before="extraParams.date=dt;">
<EventMask ShowMask="true" />
</DayClick>
</DirectEvents>
</ext:CalendarPanel>
.....
protected void Calendar_DayClick(object sender, DirectEventArgs e)
{
/*----------------Variables Declaration---------------*/
DateTime dtStart = DateTime.Parse(e.ExtraParams["date"]);
string szTitle ='xx';
/*---------------Operations-------------*/
try
{
...... //insert the event parameters to my database
...... //Refresh calendarpanel eventstore
}
catch
{
throw;
}
}
Now after I "insert the event parameters to my database", I use "re-bind calendar eventstore" to show the new evnet in the UI.I know in the "common.js" file, there is some function for the default <ext:EventEditWindow> to add the new event to show in the UI.
......
record: {
add: function(win, rec) {
win.hide();
rec.data.IsNew = false;
CompanyX.getStore().add(rec);
CompanyX.ShowMsg('Event ' + rec.data.Title + ' was added');
},
......
But I don' know how to invoke this funtion, and how generate the parameter "rec" to transfer.Could you help me?
Thanks.
Last edited by Daniil; Jun 27, 2011 at 12:26 PM.
Reason: [CLOSED]