public function init($skipGridViewInit = false) { parent::init($skipGridViewInit); // set default sort order if this widget is new $gridId = $this->getWidgetKey(); $isNew = $this->getWidgetProperty('new'); if ($isNew) { $this->asa('GridViewDbSettingsBehavior')->uid = $gridId; $this->asa('GridViewDbSettingsBehavior')->saveSetting('sort', 'createDate.desc'); // We're about to modify the profile again in setWidgetProperty. This prevents change // made in saveSetting from being wiped out $this->profile->refresh(); $this->setWidgetProperty('new', 0); } }
public function init($skipGridViewInit = false) { $modelType = self::getJSONProperty($this->profile, 'modelType', $this->widgetType, $this->widgetUID); if (class_exists($modelType)) { // custom module was deleted parent::init(false); } else { parent::init(true); } }