[CLOSED] Calendar - Change EventEditForm

Page 2 of 2 FirstFirst 12
  1. #11
    Quote Originally Posted by craig2005 View Post
    My main question was how to break the handler off to a separate method. If i did that, what params would be passed?

    <script>
     var MyHander = function(win, rec) {  
        // would i get the dataIndex passed in as the record
    }
    </script>
    
    <Listeners>
          <BeforeRender Fn="MyHander" />
    </Listeners>
    would i need to do this instead?

    <Listeners>
          <BeforeRender Fn="MyHander(dataIndex)" />
    </Listeners>
    CalendarPanel extends Ext.Panel class and got BeforeRender event from there.
    http://dev.sencha.com/deploy/dev/doc...r=beforeRender

    So, as you can see in docs only one argument is passed to BeforeRender listener and it's CalendarPanel instance.

    So, I can suggest you the following way:

    Example
    <script>
     var MyHander = function(calendar, dataIndexes) {  
        // would i get the dataIndex passed in as the record
    }
    </script>
    
    <Listeners>
          <BeforeRender Handler="myHander(this, ['dataIndex1', 'dataIndex2', ...]);" />
    </Listeners>
    Last edited by Daniil; Feb 02, 2011 at 6:27 PM. Reason: Minor correction
  2. #12
    Yes, it also works but, for me, using standard Event object makes a solution more clear and readable.
    For examples. But in the real world, it's kind of sloppy to be getting and binding data in the Page_Load method. This should be done in a controller which calls a service.

    ------

    Is there a parent for dataIndex that i can just pass? It seems kind of messy to be passing in all those params.
  3. #13
    Quote Originally Posted by craig2005 View Post
    For examples. But in the real world, it's kind of sloppy to be getting and binding data in the Page_Load method. This should be done in a controller which calls a service.
    Yes, in this case it may be better.



    Quote Originally Posted by craig2005 View Post
    Is there a parent for dataIndex that i can just pass? It seems kind of messy to be passing in all those params
    Well, you could get it here:
    store.fields.keys
    There are all fields dataIndexes of store.

    Please note that store must be rendered before its id can be used.
Page 2 of 2 FirstFirst 12

Similar Threads

  1. EventEditForm customization
    By Dimitris in forum 1.x Help
    Replies: 1
    Last Post: May 10, 2012, 7:18 AM
  2. how to change the hour in the demo My Calendar
    By diego0404 in forum 1.x Help
    Replies: 2
    Last Post: Feb 01, 2012, 12:03 AM
  3. [CLOSED] Is it possible to change default calendar colors?
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Sep 12, 2011, 5:56 PM
  4. Calendar - EventEditForm - Direct Events
    By vwagoner in forum 1.x Help
    Replies: 4
    Last Post: Jun 17, 2011, 5:27 PM
  5. [CLOSED] [1.0] Calendar change text
    By FVNoel in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 01, 2011, 10:35 AM

Tags for this Thread

Posting Permissions