Jump to:

23450 Posts in 18899 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » Adding Dropdown Calendar to Popup

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 1190 Views
  • marc79
    Avatar
    Community Member
    65 Posts

    Adding Dropdown Calendar to Popup Link to this post

    Hello,

    Is it possible to add a Calendar Date Picker to a Popup CMS window?

    I have a basic Calendar Page :

    <?php
    class CalendarPage extends Page {

    static $db = array(
       'EventDate' => 'Date',
       'EventTime' => 'Time',
       'EventTitle' => 'Text',
       'EventDescription' => 'HTMLText',
       'EventContact' => 'Text',
       'ContactEmailAdd' => 'Text'
    );

    static $has_many = array(   
          'EventCalendarDate' => 'CalendarDate',
       );

    function getCMSFields() {
    $fields = parent::getCMSFields();
       
       

    $tablefield = new ComplexTableField(
    $this,
    'EventCalendarDate',
    'CalendarDate',
    array(
              'EventDate' => 'Event Date',
              'EventTime' => 'Event Time',
              'EventTitle' => 'Title',
              'EventDescription' => 'Description',
              'EventContact' => 'Contact Name',
              'ContactEmailAdd' => 'Contact Email'
    ),

             'getCMSFields_forPopup'    

    );
    }

    class CalendarPage_Controller extends Page_Controller{

    }

    And I want to add in a Date Picker as per tutorial 2:

    $fields->addFieldToTab('Root.Content.Main', $dateField = new DateField('Date','Article Date (for example: 20/12/2010)'), 'Content');
    $dateField->setConfig('showcalendar', true);
    $dateField->setConfig('dateformat', 'dd/MM/YYYY');

    But I can't figure out or find any topics on this? Is it possible?

    Thanks

    Marc

  • BLU42 Media
    Avatar
    Community Member
    71 Posts

    Re: Adding Dropdown Calendar to Popup Link to this post

    Hey Marc-

    I used UncleCheese's DatePickerField - you can find it in the DataObjectManager module. Works great in the popup!

    -John

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