本文整理汇总了PHP中QDataGridColumn::OverrideAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP QDataGridColumn::OverrideAttributes方法的具体用法?PHP QDataGridColumn::OverrideAttributes怎么用?PHP QDataGridColumn::OverrideAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDataGridColumn
的用法示例。
在下文中一共展示了QDataGridColumn::OverrideAttributes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MetaAddTypeColumn
/**
* Similar to MetaAddColumn, except it creates a column for a Type-based Id. You MUST specify
* the name of the Type class that this will attempt to use $NameArray against.
*
* Also, $mixContent cannot be an array. Only a single field can be specified.
*
* @param mixed $mixContent string or QQNode from Country
* @param string $strTypeClassName the name of the TypeClass to use $NameArray against
* @param mixed $objOverrideParameters
*/
public function MetaAddTypeColumn($mixContent, $strTypeClassName, $objOverrideParameters = null)
{
// Validate TypeClassName
if (!class_exists($strTypeClassName) || !property_exists($strTypeClassName, 'NameArray')) {
throw new QCallerException('Invalid TypeClass Name: ' . $strTypeClassName);
}
// Validate Node
try {
$objNode = $this->ResolveContentItem($mixContent);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
// Create the Column
$strName = QConvertNotation::WordsFromCamelCase($objNode->_PropertyName);
if (strtolower(substr($strName, strlen($strName) - 3)) == ' id') {
$strName = substr($strName, 0, strlen($strName) - 3);
}
$strProperty = $objNode->GetDataGridHtml();
$objNewColumn = new QDataGridColumn(QApplication::Translate($strName), sprintf('<?=(%s) ? %s::$NameArray[%s] : null;?>', $strProperty, $strTypeClassName, $strProperty), array('OrderByClause' => QQ::OrderBy($objNode), 'ReverseOrderByClause' => QQ::OrderBy($objNode, false)));
// Perform Overrides
$objOverrideArray = func_get_args();
if (count($objOverrideArray) > 2) {
try {
unset($objOverrideArray[0]);
unset($objOverrideArray[1]);
$objNewColumn->OverrideAttributes($objOverrideArray);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
}
$this->AddColumn($objNewColumn);
return $objNewColumn;
}