[CLOSED] Calendar - two different views for previewing and editing events

  1. #1

    [CLOSED] Calendar - two different views for previewing and editing events

    is there an easy way to enable the calendar to have two different views for viewing event details?

    For example, if a user is logged in, they need to be able to edit the event. If the user isn't logged in, then the event shouldn't be editable and when the event is clicked, the user is just shown all the event information.

    There are two paths. Path one would show a form and path two would show just a window with content.

    If this isn't doable, i may just have to break away and create my own windows which i don't really want to do.
    Last edited by Daniil; Feb 08, 2011 at 2:02 PM. Reason: [CLOSED]
  2. #2
    Hi craig2005,

    There is Field's .readOnly config option to set initial state (before rendering).
    http://dev.sencha.com/deploy/dev/doc...ember=readOnly

    And Field's .setReadOnly() method to set this state on the fly.
    http://dev.sencha.com/deploy/dev/doc...er=setReadOnly
  3. #3
    yeah, but you are still looking at a form. It's a confusing and lack luster design. Users deserve better :-)

    So i'm assuming there isn't a way to branch into two views?

    If not, would this just work for any panel object or is it a little more complicated. I found this code in the showEditForm() method. I'm sure the loadRecord couldn't be used, but the rest should be good, right? Or what tweaks would i need?

    this.preEditView=this.layout.activeItem.id;
    this.setActiveView(this.id+'-edit');  // use the ID of a pre-built panel here that meets my needs.  could use in multiple panels names
    this.layout.activeItem.loadRecord(rec);
    return this;
    Last edited by Daniil; Feb 03, 2011 at 2:51 PM. Reason: Please use [CODE] tags
  4. #4
    Well, you should be able to use as many views as you wish. I will show you how it can be done.

    Lets consider Calendar's example.
    https://examples1.ext.net/#/Calendar/Overview/Basic/

    There the following EventDetails llistener.
    <EditDetails Fn="CompanyX.record.edit" Scope="CompanyX" />
    It invokes the following JavaScript code.

    Example
    edit: function(win, rec) {
        win.hide();
        CompanyX.getCalendar().showEditForm(rec);
    }
    This function is defined by developer. So, you could place any code in this function? for example:

    Example
    edit: function(win, rec) {
        win.hide();
        //here you can open your custom window
    }
    Last edited by Daniil; Feb 03, 2011 at 3:07 PM.
  5. #5
    Yeah, i've been trying that. And to place it correctly.

    edit: function (win, rec) {
                        win.hide();
                       // GroopityCalendar.getCalendar().showEditForm(rec);
                        plnCalendar.preEditView = plnCalendar.layout.activeItem.id;
                         id = "this.id + EditEvent"; // my version
                         var l = plnCalendar.layout; 
                         l.setActiveItem(id);
                         plnCalendar.getTopToolbar().hide();
                         plnCalendar.doLayout();
                         plnCalendar.activeView = l.activeItem;
                         plnCalendar.fireViewChange();
    }
    I'm getting there step by step. I'm trying reverse engineer what you guys did so i can easily put the new panel i'm creating in the same spot as the plnCalendar-edit that you guys have.

    I can't get the view to change though. Is it hard coded?
    Last edited by Daniil; Feb 03, 2011 at 4:57 PM. Reason: Please use [CODE] tags
  6. #6
    It's not hardcoded, just there is no such feature to have two 'details' views.

    Why would not you just use Window and show it in edit function?
  7. #7
    because i want it to show like the current add/edit event details panel shows. I like how it shows as a calendar view.

    Any ideas on how I can have my own panel go there?
  8. #8
    Hi,

    Well, I have idea but to implement it a developer must be rather experienced in ExtJS / JaveScript because there is no way to apply it on server side.

    Three steps:

    1. Needs to override some CalendarPanel's methods: initComponent, showEditForm, setActiveView, to apply to edit views.

    2. Needs to create custom view widgets - it's possible via ExtJS / javascript only. I took code from CalendarPanel's sources and

    3. Apply it in your page.

    Here are attached. There are 4 files: CalandarPanel-override.js, EventEditForm1.js, EventEditForm2.js and .apsx page for demonstration.

    There are not so many key points. Find '!!!' comments in js files to see ones.
    Attached Files

Similar Threads

  1. Replies: 12
    Last Post: Apr 13, 2012, 4:59 PM
  2. [CLOSED] Calendar MonthView Events
    By HOWARDJ in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 11, 2012, 5:59 PM
  3. [CLOSED] Ext.Net Calendar Control & Events
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jul 14, 2011, 3:48 PM
  4. [CLOSED] Dynamic Events in Calendar
    By FVNoel in forum 1.x Legacy Premium Help
    Replies: 12
    Last Post: Mar 23, 2011, 12:08 PM
  5. Replies: 15
    Last Post: Feb 03, 2011, 1:27 PM

Tags for this Thread

Posting Permissions