/** * CreateControls used in the filter row and set their fiter values if available. * NOTE: this function, btnReset_Click and GetControlValue are the functions to override/change if you want to add new types * * @param string $strControlId id based on the column that the control is contained * @param QDataGridLegacyColumn $objColumn the QDataGridLegacyColumn that contains the filter data. * * @return QControl $control the input control used for filtering */ protected function CreateFilterControl($strControlId, QDataGridLegacyColumn $objColumn) { //show the current filter in the control $value = $objColumn->GetActiveFilterValue(); #region Create the control //create the appropriate kind of control $actionName = 'btnFilter_Click'; $ctlFilter = null; switch ($objColumn->FilterType) { default: case QFilterType::TextFilter: $ctlFilter = $this->filterTextBox_Create($strControlId, $objColumn->Name, $objColumn->FilterBoxSize, $value); break; case QFilterType::ListFilter: $ctlFilter = $this->filterListBox_Create($strControlId, $objColumn->Name, $objColumn->FilterList, $value); break; } #endregion if (null !== $ctlFilter) { //make sure hitting enter applies the filter if ($this->blnUseAjax) { $ctlFilter->AddAction(new QEnterKeyEvent(), new QAjaxControlAction($this, $actionName, $this->objWaitIcon)); } else { $ctlFilter->AddAction(new QEnterKeyEvent(), new QServerControlAction($this, $actionName)); } $ctlFilter->AddAction(new QEnterKeyEvent(), new QTerminateAction()); } return $ctlFilter; }