Jump to:

10928 Posts in 2612 Topics by 1809 members

All other Modules

SilverStripe Forums » All other Modules » Event Calendar upgrade, extended CalendarDateTime field disappears

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1145 Views
  • toddm
    Avatar
    Community Member
    15 Posts

    Event Calendar upgrade, extended CalendarDateTime field disappears Link to this post

    Hi,

    I recently upgrade SS to 2.3.3 and then pulled down the latest Event Calendar code from SVN. I had some extension classes working nicely, but now there are issues.

    In particular, how do I get my custom field to show up in the Date popup?

    Example:

    <?php
    class CourseOrEventDateTime extends CalendarDateTime
    {
    static $db = array (
    'Location' => 'Varchar(50)'
    );

    static $has_one = array (
    'CourseOrEvent' => 'CourseOrEvent'
    );

       public function extendTable()
       {
        $this->addTableTitles(array(
        'Location' => 'Location'
        ));
        $this->addTableFields(array(
        'Location' => 'TextField'
        ));
       }
    }
    ?>

    How do I get "Location" to appear in the pop-up?

    Todd

  • toddm
    Avatar
    Community Member
    15 Posts

    Re: Event Calendar upgrade, extended CalendarDateTime field disappears Link to this post

    Wouldn't you know it, right after I post I find a "solution". Or is the following a hack?

       public function extendTable()
       {
        $this->addTableTitles(array(
        'Location' => 'Location'
        ));
        $this->addTableFields(array(
        'Location' => 'TextField'
        ));
        $newpopup = new TextField('Location');
        $this->addPopupField($newpopup);
       }

  • UncleCheese
    Avatar
    4085 Posts

    Re: Event Calendar upgrade, extended CalendarDateTime field disappears Link to this post

    Yeah, the addTableField() method is somewhat deprecated. I eventually want EventCalendar to require DataObjectManager, making the old TableFields useless. So what you did is correct. addPopupField() and addPopupFields() are what you should be using.

    1145 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.