/** * Generates code for the enclosing control to create this control. * * @param QCodeGenBase $objCodeGen * @param QSqlTable $objTable * @return string */ protected function DataListParentCreate(QCodeGenBase $objCodeGen, QSqlTable $objTable) { $strPropertyName = $objCodeGen->DataListPropertyName($objTable); $strVarName = $objCodeGen->DataListVarName($objTable); $strCode = <<<TMPL /** \t* Creates the data grid and prepares it to be row clickable. Override for additional creation operations. \t**/ \tprotected function {$strVarName}_Create() { \t\t\$this->{$strVarName} = new {$strPropertyName}List(\$this); \t\t\$this->{$strVarName}_CreateColumns(); \t\t\$this->{$strVarName}_MakeEditable(); \t\t\$this->{$strVarName}->RowParamsCallback = [\$this, "{$strVarName}_GetRowParams"]; TMPL; if (($o = $objTable->Options) && isset($o['Name'])) { // Did developer default? $strCode .= <<<TMPL \t\t\$this->{$strVarName}->Name = "{$o['Name']}"; TMPL; } // Add options coming from the config file, including the LinkedNode $strCode .= $this->ConnectorCreateOptions($objCodeGen, $objTable, null, $strVarName); $strCode .= <<<TMPL \t} TMPL; return $strCode; }