/** * Client-side Text property can only be updated after the OnLoad stage. * @param string text content for the textbox */ public function setText($value) { parent::setText($value); if ($this->getActiveControl()->canUpdateClientSide() && $this->getHasLoadedPostData()) { $cb = $this->getPage()->getCallbackClient(); $cb->setValue($this, $value); if ($this->getInputMode() == TDatePickerInputMode::DropDownList) { $s = Prado::createComponent('System.Util.TDateTimeStamp'); $date = $s->getDate($this->getTimeStampFromText()); $id = $this->getClientID(); $cb->select($id . TControl::CLIENT_ID_SEPARATOR . 'day', 'Value', $date['mday'], 'select'); $cb->select($id . TControl::CLIENT_ID_SEPARATOR . 'month', 'Value', $date['mon'] - 1, 'select'); $cb->select($id . TControl::CLIENT_ID_SEPARATOR . 'year', 'Value', $date['year'], 'select'); } } }
protected function createDateControl($container, $column, $record) { $value = $this->getRecordPropertyValue($column, $record); $control = new TDatePicker(); $control->setFromYear(1900); $control->setInputMode(TDatePickerInputMode::DropDownList); $control->setDateFormat('yyyy-MM-dd'); if (!empty($value)) { $control->setDate(substr($value, 0, 10)); } $control->setCssClass('date-dropdown'); $this->setNotNullProperty($container, $control, $column, $record); return $control; }