[CLOSED] CalendarPanel: Some question about my customized the <DirectEvents>

  1. #1

    [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 .

    ......
                        <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]
  2. #2
    Hi,

    I'd suggest you to add a record by the same way we add it in our example.

    Then you can save it to a database using the standard store's saving mechanism.
    eventStore.save();
  3. #3
    Hi,
    Quote Originally Posted by Daniil View Post
    Hi,
    I'd suggest you to add a record by the same way we add it in our example.
    Then you can save it to a database using the standard store's saving mechanism.
    eventStore.save();
    I am sorry I could not fully understand.
    (I can understand current "Basic" and "Remote Data" example of the Calendar)
    Do you mean that I must use the default <ext:EventEditWindow>?

    I tried to use a <ext: Window>, and I add some additional controls what I needed.
    In this <ext: Window>, after I add/edit/delete the event to the database, I only konw that I can refresh the calendarpanel eventstore to refresh the CalendarPanel UI and update the event. By this way, the speed is slow.

    So could you show me some more explanation about it?

    Thanks.
  4. #4
    I meant the following thing.

    If you call .save() for the eventStore.
    CalendarPanel1.eventStore.save();
    It fires the OnBeforeStoreChanged server side event where you can save the client side changes to server data store (for example, database).

    Here is the example (see the Store definition and the HandleChanges server side handler).
    https://examples1.ext.net/#/GridPanel/Update/AutoSave/

Similar Threads

  1. [CLOSED] Customized Row color on basis of some Attribute
    By jesperhp in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 29, 2012, 11:38 AM
  2. Replies: 2
    Last Post: Apr 17, 2012, 12:00 PM
  3. Calendarpanel: EventEditWindow DirectEvents
    By dotnet in forum 1.x Help
    Replies: 9
    Last Post: May 27, 2011, 10:18 AM
  4. [CLOSED] [1.0] CalendarPanel Question
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 22, 2011, 3:43 PM
  5. [CLOSED] [1.0] How to add customized CSS dynamically through Code
    By Hari_CSC in forum 1.x Legacy Premium Help
    Replies: 12
    Last Post: Aug 12, 2010, 10:12 PM

Posting Permissions