本文整理汇总了PHP中QQN类的典型用法代码示例。如果您正苦于以下问题:PHP QQN类的具体用法?PHP QQN怎么用?PHP QQN使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QQN类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Form_Create
protected function Form_Create()
{
// Setup DataGrid Columns
$this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_FORM->dtgClassProperty_EditLinkColumn_Render($_ITEM) ?>');
$this->colEditLinkColumn->HtmlEntities = false;
$this->colId = new QDataGridColumn(QApplication::Translate('Id'), '<?= $_ITEM->Id; ?>', array('OrderByClause' => QQ::OrderBy(QQN::ClassProperty()->Id), 'ReverseOrderByClause' => QQ::OrderBy(QQN::ClassProperty()->Id, false)));
$this->colQcodoClassId = new QDataGridColumn(QApplication::Translate('Qcodo Class Id'), '<?= $_FORM->dtgClassProperty_QcodoClass_Render($_ITEM); ?>');
$this->colVariableGroupId = new QDataGridColumn(QApplication::Translate('Variable Group Id'), '<?= $_FORM->dtgClassProperty_VariableGroup_Render($_ITEM); ?>');
$this->colVariableId = new QDataGridColumn(QApplication::Translate('Variable Id'), '<?= $_FORM->dtgClassProperty_Variable_Render($_ITEM); ?>');
$this->colClassVariableId = new QDataGridColumn(QApplication::Translate('Class Variable Id'), '<?= $_FORM->dtgClassProperty_ClassVariable_Render($_ITEM); ?>');
$this->colReadOnlyFlag = new QDataGridColumn(QApplication::Translate('Read Only Flag'), '<?= ($_ITEM->ReadOnlyFlag) ? "true" : "false" ?>', array('OrderByClause' => QQ::OrderBy(QQN::ClassProperty()->ReadOnlyFlag), 'ReverseOrderByClause' => QQ::OrderBy(QQN::ClassProperty()->ReadOnlyFlag, false)));
$this->colWriteOnlyFlag = new QDataGridColumn(QApplication::Translate('Write Only Flag'), '<?= ($_ITEM->WriteOnlyFlag) ? "true" : "false" ?>', array('OrderByClause' => QQ::OrderBy(QQN::ClassProperty()->WriteOnlyFlag), 'ReverseOrderByClause' => QQ::OrderBy(QQN::ClassProperty()->WriteOnlyFlag, false)));
// Setup DataGrid
$this->dtgClassProperty = new QDataGrid($this);
$this->dtgClassProperty->CellSpacing = 0;
$this->dtgClassProperty->CellPadding = 4;
$this->dtgClassProperty->BorderStyle = QBorderStyle::Solid;
$this->dtgClassProperty->BorderWidth = 1;
$this->dtgClassProperty->GridLines = QGridLines::Both;
// Datagrid Paginator
$this->dtgClassProperty->Paginator = new QPaginator($this->dtgClassProperty);
$this->dtgClassProperty->ItemsPerPage = 10;
// Specify Whether or Not to Refresh using Ajax
$this->dtgClassProperty->UseAjax = false;
// Specify the local databind method this datagrid will use
$this->dtgClassProperty->SetDataBinder('dtgClassProperty_Bind');
$this->dtgClassProperty->AddColumn($this->colEditLinkColumn);
$this->dtgClassProperty->AddColumn($this->colId);
$this->dtgClassProperty->AddColumn($this->colQcodoClassId);
$this->dtgClassProperty->AddColumn($this->colVariableGroupId);
$this->dtgClassProperty->AddColumn($this->colVariableId);
$this->dtgClassProperty->AddColumn($this->colClassVariableId);
$this->dtgClassProperty->AddColumn($this->colReadOnlyFlag);
$this->dtgClassProperty->AddColumn($this->colWriteOnlyFlag);
}
示例2: Form_Create
protected function Form_Create()
{
parent::Form_Create();
// Instantiate the Meta DataGrid
$this->dtgNarroFileProgresses = new NarroFileProgressDataGrid($this);
// Style the DataGrid (if desired)
$this->dtgNarroFileProgresses->CssClass = 'datagrid';
$this->dtgNarroFileProgresses->AlternateRowStyle->CssClass = 'alternate';
// Add Pagination (if desired)
$this->dtgNarroFileProgresses->Paginator = new QPaginator($this->dtgNarroFileProgresses);
$this->dtgNarroFileProgresses->ItemsPerPage = __FORM_DRAFTS_FORM_LIST_ITEMS_PER_PAGE__;
// Use the MetaDataGrid functionality to add Columns for this datagrid
// Create an Edit Column
$strEditPageUrl = __VIRTUAL_DIRECTORY__ . __FORM_DRAFTS__ . '/narro_file_progress_edit.php';
$this->dtgNarroFileProgresses->MetaAddEditLinkColumn($strEditPageUrl, 'Edit', 'Edit');
// Create the Other Columns (note that you can use strings for narro_file_progress's properties, or you
// can traverse down QQN::narro_file_progress() to display fields that are down the hierarchy)
$this->dtgNarroFileProgresses->MetaAddColumn('FileProgressId');
$this->dtgNarroFileProgresses->MetaAddColumn(QQN::NarroFileProgress()->File);
$this->dtgNarroFileProgresses->MetaAddColumn(QQN::NarroFileProgress()->Language);
$this->dtgNarroFileProgresses->MetaAddColumn('FileMd5');
$this->dtgNarroFileProgresses->MetaAddColumn('Header');
$this->dtgNarroFileProgresses->MetaAddColumn('TotalTextCount');
$this->dtgNarroFileProgresses->MetaAddColumn('ApprovedTextCount');
$this->dtgNarroFileProgresses->MetaAddColumn('FuzzyTextCount');
$this->dtgNarroFileProgresses->MetaAddColumn('ProgressPercent');
$this->dtgNarroFileProgresses->MetaAddColumn('Export');
}
示例3: tblProjects_Bind
/**
* Bind the Projects table to the html table.
*
* @throws QCallerException
*/
protected function tblProjects_Bind()
{
// Expand the PersonAsTeamMember node as an array so that it will be included in each item sent to the columns.
$clauses = QQ::ExpandAsArray(QQN::Project()->PersonAsTeamMember);
// We load the data source, and set it to the datagrid's DataSource parameter
$this->tblProjects->DataSource = Project::LoadAll($clauses);
}
示例4: Form_Create
protected function Form_Create()
{
// Define the DataGrid
$this->dtgPersons = new QDataGrid($this);
$this->dtgPersons->CellPadding = 5;
$this->dtgPersons->CellSpacing = 0;
// Define Columns
// Note how we add SortByCommand and ReverseSortByCommand properties to each column
$this->dtgPersons->AddColumn(new QDataGridColumn('Person ID', '<?= $_ITEM->Id ?>', 'Width=100', array('OrderByClause' => QQ::OrderBy(QQN::Person()->Id), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Person()->Id, false))));
$this->dtgPersons->AddColumn(new QDataGridColumn('First Name', '<?= $_ITEM->FirstName ?>', 'Width=200', array('OrderByClause' => QQ::OrderBy(QQN::Person()->FirstName), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Person()->FirstName, false))));
$this->dtgPersons->AddColumn(new QDataGridColumn('Last Name', '<?= $_ITEM->LastName ?>', 'Width=200', array('OrderByClause' => QQ::OrderBy(QQN::Person()->LastName), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Person()->LastName, false))));
// Let's pre-default the sorting by last name (column index #2)
$this->dtgPersons->SortColumnIndex = 2;
// Specify the Datagrid's Data Binder method
$this->dtgPersons->SetDataBinder('dtgPersons_Bind');
// Make the DataGrid look nice
$objStyle = $this->dtgPersons->RowStyle;
$objStyle->FontSize = 12;
$objStyle = $this->dtgPersons->AlternateRowStyle;
$objStyle->BackColor = '#f6f6f6';
$objStyle = $this->dtgPersons->HeaderRowStyle;
$objStyle->ForeColor = 'white';
$objStyle->BackColor = '#780000';
// Because browsers will apply different styles/colors for LINKs
// We must explicitly define the ForeColor for the HeaderLink.
// The header row turns into links when the column can be sorted.
$objStyle = $this->dtgPersons->HeaderLinkStyle;
$objStyle->ForeColor = 'white';
}
示例5: Form_Create
protected function Form_Create()
{
// Setup DataGrid Columns
$this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_FORM->dtgDatagridColumnPreference_EditLinkColumn_Render($_ITEM) ?>');
$this->colEditLinkColumn->HtmlEntities = false;
$this->colDatagridColumnPreferenceId = new QDataGridColumn(QApplication::Translate('Datagrid Column Preference Id'), '<?= $_ITEM->DatagridColumnPreferenceId; ?>', array('OrderByClause' => QQ::OrderBy(QQN::DatagridColumnPreference()->DatagridColumnPreferenceId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::DatagridColumnPreference()->DatagridColumnPreferenceId, false)));
$this->colDatagridId = new QDataGridColumn(QApplication::Translate('Datagrid Id'), '<?= $_FORM->dtgDatagridColumnPreference_Datagrid_Render($_ITEM); ?>');
$this->colColumnName = new QDataGridColumn(QApplication::Translate('Column Name'), '<?= QString::Truncate($_ITEM->ColumnName, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::DatagridColumnPreference()->ColumnName), 'ReverseOrderByClause' => QQ::OrderBy(QQN::DatagridColumnPreference()->ColumnName, false)));
$this->colUserAccountId = new QDataGridColumn(QApplication::Translate('User Account Id'), '<?= $_FORM->dtgDatagridColumnPreference_UserAccount_Render($_ITEM); ?>');
$this->colDisplayFlag = new QDataGridColumn(QApplication::Translate('Display Flag'), '<?= ($_ITEM->DisplayFlag) ? "true" : "false" ?>', array('OrderByClause' => QQ::OrderBy(QQN::DatagridColumnPreference()->DisplayFlag), 'ReverseOrderByClause' => QQ::OrderBy(QQN::DatagridColumnPreference()->DisplayFlag, false)));
// Setup DataGrid
$this->dtgDatagridColumnPreference = new QDataGrid($this);
$this->dtgDatagridColumnPreference->CellSpacing = 0;
$this->dtgDatagridColumnPreference->CellPadding = 4;
$this->dtgDatagridColumnPreference->BorderStyle = QBorderStyle::Solid;
$this->dtgDatagridColumnPreference->BorderWidth = 1;
$this->dtgDatagridColumnPreference->GridLines = QGridLines::Both;
// Datagrid Paginator
$this->dtgDatagridColumnPreference->Paginator = new QPaginator($this->dtgDatagridColumnPreference);
$this->dtgDatagridColumnPreference->ItemsPerPage = 10;
// Specify Whether or Not to Refresh using Ajax
$this->dtgDatagridColumnPreference->UseAjax = false;
// Specify the local databind method this datagrid will use
$this->dtgDatagridColumnPreference->SetDataBinder('dtgDatagridColumnPreference_Bind');
$this->dtgDatagridColumnPreference->AddColumn($this->colEditLinkColumn);
$this->dtgDatagridColumnPreference->AddColumn($this->colDatagridColumnPreferenceId);
$this->dtgDatagridColumnPreference->AddColumn($this->colDatagridId);
$this->dtgDatagridColumnPreference->AddColumn($this->colColumnName);
$this->dtgDatagridColumnPreference->AddColumn($this->colUserAccountId);
$this->dtgDatagridColumnPreference->AddColumn($this->colDisplayFlag);
}
示例6: __construct
public function __construct(QcodoClass $objClass, $objParentControl, $strControlId = null)
{
parent::__construct($objParentControl, $strControlId);
$this->objQcodoClass = $objClass;
$this->strTemplate = 'ClassPanel.tpl.php';
$this->strUrl = 'http://' . $_SERVER['HTTP_HOST'] . '/index.php/' . $this->objQcodoClass->Name;
$this->strShortDescriptionHtml = $this->objQcodoClass->ShortDescriptionAsHtml;
if (!$this->strShortDescriptionHtml) {
$this->strShortDescriptionHtml = '<span style="color: #888888;"><i>No description entered yet.</i></span>';
}
$this->strLongDescriptionHtml = QWriteBox::DisplayHtml($this->objQcodoClass->ExtendedDescription, 'writebox_code');
$this->strVersion = 'Qcodo >= ' . $this->objQcodoClass->FirstVersion;
if ($this->objQcodoClass->LastVersion) {
$this->strVersion .= ' - Deprecated as of ' . $this->objQcodoClass->LastVersion;
}
$this->strParentClassArray[$objClass->Id] = $objClass->DisplayName;
$objParentClass = $objClass->ParentQcodoClass;
while ($objParentClass) {
$this->strParentClassArray[$objParentClass->Id] = $objParentClass->DisplayName;
$objParentClass = $objParentClass->ParentQcodoClass;
}
$this->strParentClassArray = array_reverse($this->strParentClassArray, true);
foreach ($this->objQcodoClass->GetChildQcodoClassArray(QQ::Clause(QQ::OrderBy(QQN::QcodoClass()->Name))) as $objChildClass) {
$this->strChildClassArray[$objChildClass->Id] = $objChildClass->DisplayName;
}
if (QApplication::$Login) {
$this->strEditLink = '<div class="edit_link" title="Edit" onclick="document.location=\'/edit_class.php/';
$this->strEditLink .= $this->objQcodoClass->Id;
$this->strEditLink .= '\'">EDIT</div>';
}
}
示例7: Form_Create
protected function Form_Create()
{
// Setup DataGrid Columns
$this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_FORM->dtgAudit_EditLinkColumn_Render($_ITEM) ?>');
$this->colEditLinkColumn->HtmlEntities = false;
$this->colAuditId = new QDataGridColumn(QApplication::Translate('Audit Id'), '<?= $_ITEM->AuditId; ?>', array('OrderByClause' => QQ::OrderBy(QQN::Audit()->AuditId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Audit()->AuditId, false)));
$this->colEntityQtypeId = new QDataGridColumn(QApplication::Translate('Entity Qtype'), '<?= $_FORM->dtgAudit_EntityQtypeId_Render($_ITEM); ?>', array('OrderByClause' => QQ::OrderBy(QQN::Audit()->EntityQtypeId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Audit()->EntityQtypeId, false)));
$this->colCreatedBy = new QDataGridColumn(QApplication::Translate('Created By'), '<?= $_FORM->dtgAudit_CreatedByObject_Render($_ITEM); ?>');
$this->colCreationDate = new QDataGridColumn(QApplication::Translate('Creation Date'), '<?= $_FORM->dtgAudit_CreationDate_Render($_ITEM); ?>', array('OrderByClause' => QQ::OrderBy(QQN::Audit()->CreationDate), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Audit()->CreationDate, false)));
$this->colModifiedBy = new QDataGridColumn(QApplication::Translate('Modified By'), '<?= $_FORM->dtgAudit_ModifiedByObject_Render($_ITEM); ?>');
$this->colModifiedDate = new QDataGridColumn(QApplication::Translate('Modified Date'), '<?= QString::Truncate($_ITEM->ModifiedDate, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::Audit()->ModifiedDate), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Audit()->ModifiedDate, false)));
// Setup DataGrid
$this->dtgAudit = new QDataGrid($this);
$this->dtgAudit->CellSpacing = 0;
$this->dtgAudit->CellPadding = 4;
$this->dtgAudit->BorderStyle = QBorderStyle::Solid;
$this->dtgAudit->BorderWidth = 1;
$this->dtgAudit->GridLines = QGridLines::Both;
// Datagrid Paginator
$this->dtgAudit->Paginator = new QPaginator($this->dtgAudit);
$this->dtgAudit->ItemsPerPage = 10;
// Specify Whether or Not to Refresh using Ajax
$this->dtgAudit->UseAjax = false;
// Specify the local databind method this datagrid will use
$this->dtgAudit->SetDataBinder('dtgAudit_Bind');
$this->dtgAudit->AddColumn($this->colEditLinkColumn);
$this->dtgAudit->AddColumn($this->colAuditId);
$this->dtgAudit->AddColumn($this->colEntityQtypeId);
$this->dtgAudit->AddColumn($this->colCreatedBy);
$this->dtgAudit->AddColumn($this->colCreationDate);
$this->dtgAudit->AddColumn($this->colModifiedBy);
$this->dtgAudit->AddColumn($this->colModifiedDate);
}
示例8: Form_Create
protected function Form_Create()
{
parent::Form_Create();
// Instantiate the Meta DataGrid
$this->dtgNarroLogs = new NarroLogDataGrid($this);
// Style the DataGrid (if desired)
$this->dtgNarroLogs->CssClass = 'datagrid';
$this->dtgNarroLogs->AlternateRowStyle->CssClass = 'alternate';
// Add Pagination (if desired)
$this->dtgNarroLogs->Paginator = new QPaginator($this->dtgNarroLogs);
$this->dtgNarroLogs->ItemsPerPage = __FORM_DRAFTS_FORM_LIST_ITEMS_PER_PAGE__;
// Use the MetaDataGrid functionality to add Columns for this datagrid
// Create an Edit Column
$strEditPageUrl = __VIRTUAL_DIRECTORY__ . __FORM_DRAFTS__ . '/narro_log_edit.php';
$this->dtgNarroLogs->MetaAddEditLinkColumn($strEditPageUrl, 'Edit', 'Edit');
// Create the Other Columns (note that you can use strings for narro_log's properties, or you
// can traverse down QQN::narro_log() to display fields that are down the hierarchy)
$this->dtgNarroLogs->MetaAddColumn('LogId');
$this->dtgNarroLogs->MetaAddColumn(QQN::NarroLog()->Language);
$this->dtgNarroLogs->MetaAddColumn(QQN::NarroLog()->Project);
$this->dtgNarroLogs->MetaAddColumn(QQN::NarroLog()->User);
$this->dtgNarroLogs->MetaAddColumn('Message');
$this->dtgNarroLogs->MetaAddColumn('Priority');
$this->dtgNarroLogs->MetaAddColumn('Date');
}
示例9: Form_Create
protected function Form_Create()
{
parent::Form_Create();
// Instantiate the Meta DataGrid
$this->dtgNarroFiles = new NarroFileDataGrid($this);
// Style the DataGrid (if desired)
$this->dtgNarroFiles->CssClass = 'datagrid';
$this->dtgNarroFiles->AlternateRowStyle->CssClass = 'alternate';
// Add Pagination (if desired)
$this->dtgNarroFiles->Paginator = new QPaginator($this->dtgNarroFiles);
$this->dtgNarroFiles->ItemsPerPage = __FORM_DRAFTS_FORM_LIST_ITEMS_PER_PAGE__;
// Use the MetaDataGrid functionality to add Columns for this datagrid
// Create an Edit Column
$strEditPageUrl = __VIRTUAL_DIRECTORY__ . __FORM_DRAFTS__ . '/narro_file_edit.php';
$this->dtgNarroFiles->MetaAddEditLinkColumn($strEditPageUrl, 'Edit', 'Edit');
// Create the Other Columns (note that you can use strings for narro_file's properties, or you
// can traverse down QQN::narro_file() to display fields that are down the hierarchy)
$this->dtgNarroFiles->MetaAddColumn('FileId');
$this->dtgNarroFiles->MetaAddColumn('FileName');
$this->dtgNarroFiles->MetaAddColumn('FilePath');
$this->dtgNarroFiles->MetaAddColumn('FileMd5');
$this->dtgNarroFiles->MetaAddColumn(QQN::NarroFile()->Parent);
$this->dtgNarroFiles->MetaAddTypeColumn('TypeId', 'NarroFileType');
$this->dtgNarroFiles->MetaAddColumn(QQN::NarroFile()->Project);
$this->dtgNarroFiles->MetaAddColumn('Active');
$this->dtgNarroFiles->MetaAddColumn('Created');
$this->dtgNarroFiles->MetaAddColumn('Modified');
$this->dtgNarroFiles->MetaAddColumn('Header');
}
示例10: Form_Create
protected function Form_Create()
{
// Define the DataGrid -- note that the Meta DataGrid is a DataGrid, itself --
// so let's just use it as a datagrid
$this->dtgProjects = new ProjectDataGrid($this);
// DataBinding is already configured -- so we do not need to worry about it
// But remember that dtgProjects is just a regular datagrid, as well
// So we can configure as we see fit, e.g. adding pagination or styling
$this->dtgProjects->Paginator = new QPaginator($this->dtgProjects);
$this->dtgProjects->ItemsPerPage = 6;
$this->dtgProjects->AlternateRowStyle->CssClass = 'alternate';
// All we need to do is to utilize the ProjectDataGrid built-in functionality
// to create, define and setup the various columns that WE choose, in the order
// that WE want. NOTE that we use simple string-based property names, OR QQuery
// node descriptors to specify what we want for each column.
$this->dtgProjects->MetaAddColumn('Name');
$this->dtgProjects->MetaAddColumn('StartDate');
$this->dtgProjects->MetaAddColumn(QQN::Project()->EndDate);
// We can easily add columns from linked/related tables. However, to do this
// you MUST use a QQuery node descriptor. No string-based properties allowed.
// Bonus: the Meta DataGrid will even automatically add sorting for columns in related tables.
$colUsername = $this->dtgProjects->MetaAddColumn(QQN::Project()->ManagerPerson->Login->Username);
// And remember, since it's a regular datagrid with regular columns,
// we can stylize as we see fit
$colUsername->BackColor = '#cef';
$colUsername->Name = 'Manager\'s Username';
// Also, note that MetaAddColumn and MetaAddTypeColumn can use attribute overriding as well
$this->dtgProjects->MetaAddTypeColumn('ProjectStatusTypeId', 'ProjectStatusType', 'FontBold=true');
$this->pxyExample = new QControlProxy($this);
$this->pxyExample->AddAction(new QClickEvent(), new QAjaxAction('pxyExample_Click'));
// FInally, there are even Meta methods to add an Edit Button column
$this->dtgProjects->MetaAddEditProxyColumn($this->pxyExample, 'Click Me', 'Faux Edit Column');
}
示例11: Form_Create
protected function Form_Create()
{
// Setup Household Object
$this->objHousehold = Household::Load(QApplication::PathInfo(0));
if (!$this->objHousehold) {
QApplication::Redirect('/households/');
}
$this->strPageTitle .= $this->objHousehold->Name;
// Setup DataGrids
$this->dtgMembers = new HouseholdParticipationDataGrid($this);
$this->dtgMembers->AddColumn(new QDataGridColumn('Remove', '<?= $_FORM->RenderRadio($_ITEM); ?>', 'Width=80px', 'HtmlEntities=false'));
$this->dtgMembers->MetaAddColumn('Role', 'Width=80px');
$this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->FirstName, 'Name=Name', 'Html=<?= $_ITEM->Person->LinkHtml; ?>', 'HtmlEntities=false', 'Width=300px');
$this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->PrimaryEmail->Address, 'Name=Email', 'Width=250px');
$this->dtgMembers->MetaAddColumn(QQN::HouseholdParticipation()->Person->PrimaryPhone->Number, 'Name=Phone', 'Width=200px');
$this->dtgMembers->GetColumn(0)->OrderByClause = null;
$this->dtgMembers->GetColumn(1)->OrderByClause = null;
$this->dtgMembers->GetColumn(2)->OrderByClause = null;
$this->dtgMembers->GetColumn(3)->OrderByClause = null;
$this->dtgMembers->GetColumn(4)->OrderByClause = null;
$this->dtgMembers->DataSource = $this->objHousehold->GetOrderedParticipantArray();
$this->btnSave = new QButton($this);
$this->btnSave->Text = 'Remove';
$this->btnSave->CssClass = 'primary';
$this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click'));
$this->btnSave->CausesValidation = true;
$this->btnCancel = new QLinkButton($this);
$this->btnCancel->Text = 'Cancel';
$this->btnCancel->CssClass = 'cancel';
$this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click'));
$this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction());
$this->dlgMessage = new MessageDialog($this);
}
示例12: Form_Create
protected function Form_Create()
{
// Define the DataGrid
$this->dtgPersons = new QDataGrid($this);
$this->dtgPersons->CellPadding = 5;
$this->dtgPersons->CellSpacing = 0;
// Specify Pagination with 10 items per page
$objPaginator = new QPaginator($this->dtgPersons);
$this->dtgPersons->Paginator = $objPaginator;
$this->dtgPersons->ItemsPerPage = 10;
// Define Columns
$this->dtgPersons->AddColumn(new QDataGridColumn('Person ID', '<?= $_ITEM->Id ?>', 'Width=100', array('OrderByClause' => QQ::OrderBy(QQN::Person()->Id), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Person()->Id, false))));
$this->dtgPersons->AddColumn(new QDataGridColumn('First Name', '<?= $_ITEM->FirstName ?>', 'Width=200', array('OrderByClause' => QQ::OrderBy(QQN::Person()->FirstName), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Person()->FirstName, false))));
$this->dtgPersons->AddColumn(new QDataGridColumn('Last Name', '<?= $_ITEM->LastName ?>', 'Width=200', array('OrderByClause' => QQ::OrderBy(QQN::Person()->LastName), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Person()->LastName, false))));
// For the last column we will be calling a PHP method on the form
// to help with the dynamic creation of a Checkbox
$this->dtgPersons->AddColumn(new QDataGridColumn('Select Person', '<?= $_FORM->chkSelected_Render($_ITEM) ?>', 'HtmlEntities=false'));
// Let's pre-default the sorting by last name (column index #2)
$this->dtgPersons->SortColumnIndex = 2;
// Specify the DataBinder method for the DataGrid
$this->dtgPersons->SetDataBinder('dtgPersons_Bind');
// Make the DataGrid look nice
$objStyle = $this->dtgPersons->RowStyle;
$objStyle->FontSize = 12;
$objStyle = $this->dtgPersons->AlternateRowStyle;
$objStyle->BackColor = '#f6f6f6';
// Define the Label -- keep it blank for now
$this->lblResponse = new QLabel($this);
$this->lblResponse->HtmlEntities = false;
}
示例13: dtgStaff_Bind
public function dtgStaff_Bind()
{
$objConditions = QQ::All();
if ($this->lstMinistry->SelectedValue) {
$objConditions = QQ::AndCondition($objConditions, QQ::Equal(QQN::Login()->Ministry->MinistryId, $this->lstMinistry->SelectedValue));
}
if ($this->lstActiveFlag->SelectedValue) {
$objConditions = QQ::AndCondition($objConditions, QQ::Equal(QQN::Login()->DomainActiveFlag, true), QQ::Equal(QQN::Login()->LoginActiveFlag, true));
} else {
$objConditions = QQ::AndCondition($objConditions, QQ::OrCondition(QQ::Equal(QQN::Login()->DomainActiveFlag, false), QQ::Equal(QQN::Login()->LoginActiveFlag, false)));
}
$this->dtgStaff->TotalItemCount = Login::QueryCount($objConditions);
// Setup the $objClauses Array
$objClauses = array();
// If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add
// the OrderByClause to the $objClauses array
if ($objClause = $this->dtgStaff->OrderByClause) {
array_push($objClauses, $objClause);
}
// Add the LimitClause information, as well
if ($objClause = $this->dtgStaff->LimitClause) {
array_push($objClauses, $objClause);
}
// Set the DataSource to be a Query result from Login, given the clauses above
$this->dtgStaff->DataSource = Login::QueryArray($objConditions, $objClauses);
}
示例14: Form_Create
protected function Form_Create()
{
// Instantiate the DataGrid
$this->dtgProjects = new QDataGrid($this);
// Style the DataGrid
//$this->dtgProjects->CssClass = 'datagrid';
$this->dtgProjects->AlternateRowCssClass = 'alternate';
// Add Pagination
$this->dtgProjects->Paginator = new QPaginator($this->dtgProjects);
$this->dtgProjects->ItemsPerPage = 3;
// Add columns
// Create a column that will hold a toggle button. We will need to manually draw the content of the cell.
$col = $this->dtgProjects->CreateCallableColumn('', [$this, 'render_btnToggleRecordsSummary']);
$col->HtmlEntities = false;
$col->CellStyler->Width = "1%";
$this->dtgProjects->CreateNodeColumn('Id', QQN::Project()->Id);
$this->dtgProjects->CreateNodeColumn('Name', QQN::Project()->Name);
$this->dtgProjects->CreateNodeColumn('Status', QQN::Project()->ProjectStatusType);
$this->dtgProjects->CreateNodeColumn('Description', QQN::Project()->Description);
$this->dtgProjects->CreateNodeColumn('Start Date', QQN::Project()->StartDate);
$this->dtgProjects->CreateNodeColumn('End Date', QQN::Project()->EndDate);
$this->dtgProjects->CreateNodeColumn('Budget', QQN::Project()->Budget);
$this->dtgProjects->CreateNodeColumn('Spent', QQN::Project()->Spent);
// Create a column that will hold a child datagrid
$col = $this->dtgProjects->CreateCallableColumn('', [$this, 'render_ucRecordsSummary']);
$col->HtmlEntities = false;
$col->CellStyler->Width = 0;
// Specify the Datagrid's Data Binder method
$this->dtgProjects->SetDataBinder('dtgProjects_Bind');
// For purposes of this example, add a css file that styles the table.
// Normally you would include your global style sheets in your tpl file or header.inc.php file.
$this->dtgProjects->AddCssFile(__QCUBED_ASSETS__ . '/php/examples/master_detail/styles.css');
}
示例15: Form_Create
protected function Form_Create()
{
$this->mctObject = ClassInstructorMetaControl::CreateFromPathInfo($this, QMetaControlCreateType::CreateOnRecordNotFound);
if ($this->mctObject->EditMode) {
$this->strPageTitle .= 'Edit Instructor';
} else {
$this->strPageTitle .= 'Create New Instructor';
}
$this->lstLogin = $this->mctObject->lstLogin_Create(null, QQ::OrCondition(QQ::AndCondition(QQ::IsNull(QQN::Login()->ClassInstructor->Id), QQ::Equal(QQN::Login()->LoginActiveFlag, true), QQ::Equal(QQN::Login()->DomainActiveFlag, true)), QQ::Equal(QQN::Login()->Id, $this->mctObject->ClassInstructor->LoginId)), QQ::OrderBy(QQN::Login()->FirstName, QQN::Login()->LastName));
$this->txtDisplayName = $this->mctObject->txtDisplayName_Create();
$this->txtDisplayName->AddAction(new QEnterKeyEvent(), new QTerminateAction());
$this->btnSave = new QButton($this);
$this->btnSave->CssClass = 'primary';
$this->btnSave->Text = $this->mctObject->EditMode ? 'Update' : 'Create';
$this->btnSave->CausesValidation = true;
$this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click'));
$this->btnSave->AddAction(new QClickEvent(), new QTerminateAction());
$this->btnCancel = new QLinkButton($this);
$this->btnCancel->CssClass = 'cancel';
$this->btnCancel->Text = 'Cancel';
$this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click'));
$this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction());
if ($this->mctObject->EditMode) {
$this->btnDelete = new QLinkButton($this);
$this->btnDelete->CssClass = 'delete';
$this->btnDelete->Text = 'Delete';
$this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction('Are you SURE you want to PERMANENTLY DELETE this?'));
$this->btnDelete->AddAction(new QClickEvent(), new QAjaxAction('btnDelete_Click'));
$this->btnDelete->AddAction(new QClickEvent(), new QTerminateAction());
}
}