Jump to:

10994 Posts in 2728 Topics by 1819 members

All other Modules

SilverStripe Forums » All other Modules » Issues with extendTable for the Event Calendar

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 824 Views
  • Andrew Houle
    Avatar
    Community Member
    132 Posts

    Issues with extendTable for the Event Calendar Link to this post

    I'm trying to remove the 'All Day' field in the DateTime tab to simplify it. I've extended things with Calendar, CalendarEvent and CalendarDateTime subclasses. Now I'm adding an extendTable() function to my CalendarDateTime subclass. I've tried many things (as you can see) to try and remove the All Day checkbox and table header. I'm pretty sure the subclasses are setup correctly because the added Field 'Notes' works properly. Anyone see what I'm missing, or has this functionality been removed? I'm using SS2.4, event calendar #111 and dom #414

    public function extendTable() {
       $this->setComplex(true);
       $this->addPopupField(new TextField('Notes'));
       $this->addTableTitle('Notes','Notes');
       $this->removePopupField('is_all_day');
       $this->removePopupField('All day');
       $this->removePopupField('All Day');
       $this->removeTableField('is_all_day');
       $this->removeTableField('All day');
       $this->removeTableField('All Day');
       $this->removeTableTitle('is_all_day','All day');
       $this->removeTableTitle('All day');
       $this->removeTableTitle('All Day');
    }

    Thanks in advance,
    Andrew

  • UncleCheese
    Avatar
    4085 Posts

    Re: Issues with extendTable for the Event Calendar Link to this post

    Ugh, this is kind of ugly.

    $this->removeTableField('FormattedAllDay');

  • Andrew Houle
    Avatar
    Community Member
    132 Posts

    Re: Issues with extendTable for the Event Calendar Link to this post

    Hey UC,

    Thanks for your help! This worked for the table header... $this->removeTableTitle('FormattedAllDay'); but neither of these... $this->removeTableField('FormattedAllDay'); $this->removePopupField('FormattedAllDay'); worked for the popup field itself.

    Thanks,
    Andrew

  • UncleCheese
    Avatar
    4085 Posts

    Re: Issues with extendTable for the Event Calendar Link to this post

    For the popup field itself, you can use "is_all_day", but because the table field uses a formatting function, you have to refer to it by the name of the function.

  • Andrew Houle
    Avatar
    Community Member
    132 Posts

    Re: Issues with extendTable for the Event Calendar Link to this post

    ugh, sorry to keep this going, but neither $this->removePopupField('is_all_day'); or $this->removeTableField('is_all_day'); seem to work. What is the right syntax?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Issues with extendTable for the Event Calendar Link to this post

    It's ok.. this module just needs to be completely destroyed and rebuilt. This whole system of extending it is so screwy.

    Try running an update.. I changed some stuff in CalendarDateTime.php that should help you.

  • Andrew Houle
    Avatar
    Community Member
    132 Posts

    Re: Issues with extendTable for the Event Calendar Link to this post

    That's the one! Thanks for the help.

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