/** * Creates a new callback control, sets the adapter to * TActiveListControlAdapter. If you override this class, be sure to set the * adapter appropriately by, for example, by calling this constructor. */ public function __construct() { $this->setAdapter(new TActiveListControlAdapter($this)); $this->setAutoPostBack(true); parent::__construct(); }
protected function createSetControl($container, $column, $record) { $value = $this->getRecordPropertyValue($column, $record); $selectedValues = preg_split('/\\s*,\\s*/', $value); $control = new TCheckBoxList(); $values = $column->getDbTypeValues(); $control->setDataSource($values); $control->dataBind(); $control->setSelectedIndices($this->getMatchingIndices($values, $selectedValues)); $control->setID(self::DEFAULT_ID); $control->setCssClass('set-checkboxes'); $this->setNotNullProperty($container, $control, $column, $record); return $control; }
/** * Ensure that the ID attribute is rendered and registers the javascript code * for initializing the active control. */ protected function addAttributesToRender($writer) { parent::addAttributesToRender($writer); $this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(), $this->getPostBackOptions()); }
/** * Ensure that the ID attribute is rendered and registers the javascript code * for initializing the active control. */ protected function addAttributesToRender($writer) { parent::addAttributesToRender($writer); if ($this->getEnableClientScript() && $this->getAutoPostBack() && $this->getPage()->getClientSupportsJavaScript()) { $this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(), $this->getPostBackOptions()); } }