本文整理汇总了PHP中QButton::Render方法的典型用法代码示例。如果您正苦于以下问题:PHP QButton::Render方法的具体用法?PHP QButton::Render怎么用?PHP QButton::Render使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QButton
的用法示例。
在下文中一共展示了QButton::Render方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dtg_ButtonRender
public function dtg_ButtonRender($item)
{
$strControl = new QButton($this);
$strControl->Text = 'Button';
$strControl->ActionParameter = $item;
$strControl->AddAction(new QClickEvent(), new QServerAction('btn_click'));
return $strControl->Render(false);
}
示例2: dtgDatagrid_EditLinkColumn_Render
public function dtgDatagrid_EditLinkColumn_Render(Datagrid $objDatagrid)
{
$strControlId = 'btnEdit' . $this->dtgDatagrid->CurrentRowIndex;
$btnEdit = $this->objForm->GetControl($strControlId);
if (!$btnEdit) {
$btnEdit = new QButton($this->dtgDatagrid, $strControlId);
$btnEdit->Text = QApplication::Translate('Edit');
$btnEdit->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnEdit_Click'));
}
$btnEdit->ActionParameter = $objDatagrid->DatagridId;
return $btnEdit->Render(false);
}
示例3: renderButton
public function renderButton(Person $objPerson)
{
$objControlId = "editButton" . $objPerson->Id;
if (!($objControl = $this->GetControl($objControlId))) {
$objControl = new QButton($this, $objControlId);
$objControl->Text = "Edit Person #" . $objPerson->Id;
$objControl->AddAction(new QClickEvent(), new QAjaxAction("renderButton_Click"));
$objControl->ActionParameter = $objPerson->Id;
}
// We pass the parameter of "false" to make sure the control doesn't render
// itself RIGHT HERE - that it instead returns its string rendering result.
return $objControl->Render(false);
}
示例4: RenderDeleteButton
/**
* A non-delegated event version. Create a new button for each control and attach an action to it.
*
* @param Person $objPerson
* @return String
*/
public function RenderDeleteButton($objPerson)
{
$strControlId = 'btn' . $objPerson->Id;
$objControl = $this->GetControl($strControlId);
if (!$objControl) {
$objControl = new QButton($this);
$objControl->Text = 'Edit';
$objControl->ActionParameter = $objPerson->Id;
$objControl->AddAction(new QClickEvent(), new QAjaxAction('dtgPersonsButton_Click'));
// This will generate a javascript call for every button created.
}
return $objControl->Render(false);
}
示例5: lnkSelected_Render
public function lnkSelected_Render(Praises $objPraise)
{
$strControlId = 'lnkSelected' . $objPraise->Id;
// Let's see if the Checkbox exists already
$lnkSelected = $this->GetControl($strControlId);
if (!$lnkSelected) {
$lnkSelected = new QButton($this->dtgPraises, $strControlId);
$lnkSelected->Text = $objPraise->Subject;
$lnkSelected->ActionParameter = $objPraise->Id;
$lnkSelected->CssClass = 'linkButton';
$lnkSelected->AddAction(new QClickEvent(), new QServerAction('lnkSelected_Click'));
}
return $lnkSelected->Render(false);
}
示例6: EditColumn_Render
public function EditColumn_Render(Attribute $objAttribute)
{
// Let's specify a specific Control ID for our button, using the datagrid's CurrentRowIndex
$strControlId = 'btnEditAttribute' . $this->dtgAttributes->CurrentRowIndex;
$btnEdit = $this->objForm->GetControl($strControlId);
if (!$btnEdit) {
// Only create/instantiate a new Edit button for this Row if it doesn't yet exist
$btnEdit = new QButton($this->dtgAttributes, $strControlId);
$btnEdit->Text = 'Add';
$btnEdit->CssClass = 'primary';
// Define an Event Handler on the Button
// Because the event handler, itself, is defined in the control, we use QAjaxControlAction instead of QAjaxAction
$btnEdit->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnEditAttribute_Click'));
}
// Finally, update the Actionparameter for our button to store the $objAttribute's ID.
$btnEdit->ActionParameter = $objAttribute->Id . "_" . $objAttribute->AttributeDataTypeId . "_" . $objAttribute->Name . "_" . $this->dtgAttributes->CurrentRowIndex;
// Return the Rendered Button Control
return $btnEdit->Render(false);
}
示例7: render_btnToggleRecordsSummary
public function render_btnToggleRecordsSummary(Project $objProject)
{
// Create their unique id...
$objControlId = 'btnToggleRecordsSummary' . $objProject->Id;
if (!($objControl = $this->GetControl($objControlId))) {
$intTeamMemberCount = Person::CountByProjectAsTeamMember($objProject->Id);
if ($intTeamMemberCount > 0) {
// If not exists create our toggle button who his parent
// is our master QDataGrid...
$objControl = new QButton($this->dtgProjects, $objControlId);
$objControl->Width = 25;
$objControl->Text = '+' . $intTeamMemberCount;
$objControl->CssClass = 'inputbutton';
// Pass the id of the bounded item just for other process
// on click event
$objControl->ActionParameter = $objProject->Id;
// Add event on click the toogle button
$objControl->AddAction(new QClickEvent(), new QAjaxAction('btnToggleRecordsSummary_Click'));
}
}
// We pass the parameter of "false" to make sure the control doesn't render
// itself RIGHT HERE - that it instead returns its string rendering result.
return $objControl->Render(false);
}
示例8: EditColumn_Render
public function EditColumn_Render(Person $objPerson)
{
if ($objPerson->Id == $this->intEditPersonId || $this->intEditPersonId == -1 && !$objPerson->Id) {
// We are rendering the row of the person we are editing OR we are rending the row
// of the NEW (blank) person. Go ahead and render the Save and Cancel buttons.
return $this->btnSave->Render(false) . ' ' . $this->btnCancel->Render(false);
} else {
// Get the Edit button for this row (we will create it if it doesn't yet exist)
$strControlId = 'btnEdit' . $objPerson->Id;
$btnEdit = $this->GetControl($strControlId);
if (!$btnEdit) {
// Create the Edit button for this row in the DataGrid
// Use ActionParameter to specify the ID of the person
$btnEdit = new QButton($this->dtgPersons, $strControlId);
$btnEdit->Text = 'Edit This Person';
$btnEdit->ActionParameter = $objPerson->Id;
$btnEdit->AddAction(new QClickEvent(), new QAjaxAction('btnEdit_Click'));
$btnEdit->CausesValidation = false;
}
// If we are currently editing a person, then set this Edit button to be disabled
if ($this->intEditPersonId) {
$btnEdit->Enabled = false;
} else {
$btnEdit->Enabled = true;
}
// Return the rendered Edit button
return $btnEdit->Render(false);
}
}
示例9: RenderSelect
public function RenderSelect(Person $objPerson, $intRow)
{
$strControlId = 'chkSelected' . $objPerson->Id . $intRow;
$btnSelect = $this->objForm->GetControl($strControlId);
if (!$btnSelect) {
$btnSelect = new QButton($this->dtgPeople, $strControlId);
$btnSelect->Text = 'Select';
$btnSelect->CssClass = 'primary';
$btnSelect->ActionParameter = $objPerson->Id;
$btnSelect->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'pxySelect_Click'));
$btnSelect->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnSelect_Click'));
}
return $btnSelect->Render(false);
}
示例10: dtgUserRole_ActionsColumn_Render
public function dtgUserRole_ActionsColumn_Render(NarroUserRole $objUserRole)
{
$strControlId = 'btnEditRole' . $objUserRole->UserRoleId;
$btnEdit = $this->Form->GetControl($strControlId);
if (!$btnEdit) {
$btnEdit = new QButton($this->dtgUserRole, $strControlId);
$btnEdit->Text = t('Edit');
if (QApplication::$UseAjax) {
$btnEdit->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnEditRole_Click'));
} else {
$btnEdit->AddAction(new QClickEvent(), new QServerControlAction($this, 'btnEditRole_Click'));
}
}
$btnEdit->ActionParameter = $objUserRole->UserRoleId;
$btnEdit->Display = QApplication::HasPermission('Can manage user roles', $objUserRole->ProjectId, $objUserRole->LanguageId);
$strControlId = 'btnDeleteRole' . $objUserRole->UserRoleId;
$btnDelete = $this->Form->GetControl($strControlId);
if (!$btnDelete) {
$btnDelete = new QButton($this->dtgUserRole, $strControlId);
$btnDelete->Text = t('Delete');
$btnDelete->AddAction(new QClickEvent(), new QConfirmAction(t('Are you sure you want to revoke this role for this user?')));
if (QApplication::$UseAjax) {
$btnDelete->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnDeleteRole_Click'));
} else {
$btnDelete->AddAction(new QClickEvent(), new QServerControlAction($this, 'btnDeleteRole_Click'));
}
}
$btnDelete->ActionParameter = $objUserRole->UserRoleId;
$btnDelete->Display = QApplication::HasPermission('Can manage user roles', $objUserRole->ProjectId, $objUserRole->LanguageId);
return $btnEdit->Render(false) . ' ' . $btnDelete->Render(false);
}
示例11: dtgNotificationUserAccount_EditLinkColumn_Render
public function dtgNotificationUserAccount_EditLinkColumn_Render(NotificationUserAccount $objNotificationUserAccount)
{
$strControlId = 'btnEdit' . $this->dtgNotificationUserAccount->CurrentRowIndex;
$btnEdit = $this->objForm->GetControl($strControlId);
if (!$btnEdit) {
$btnEdit = new QButton($this->dtgNotificationUserAccount, $strControlId);
$btnEdit->Text = QApplication::Translate('Edit');
$btnEdit->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnEdit_Click'));
}
$btnEdit->ActionParameter = $objNotificationUserAccount->NotificationUserAccountId;
return $btnEdit->Render(false);
}
示例12: RemoveColumn_Render
public function RemoveColumn_Render(InventoryLocation $objInventoryLocation)
{
// If the transaction is a Move or a Take Out, use the InventoryLocationId as the Action Parameter
if ($this->ctlInventoryTransact->intTransactionTypeId == 1 || $this->ctlInventoryTransact->intTransactionTypeId == 5) {
$strControlId = 'btnRemove' . $objInventoryLocation->InventoryLocationId;
} elseif ($this->ctlInventoryTransact->intTransactionTypeId == 4) {
$strControlId = 'btnRemove' . $objInventoryLocation->InventoryModelId;
}
$btnRemove = $this->GetControl($strControlId);
if (!$btnRemove) {
// Create the Remove button for this row in the DataGrid
// Use ActionParameter to specify the ID of the InventoryLocation or InventoryModelId, depending on the transaction type
$btnRemove = new QButton($this->ctlInventoryTransact->dtgInventoryTransact, $strControlId);
$btnRemove->Text = 'Remove';
// If the transaction is a Move or a Take Out, use the InventoryLocationId as the Action Parameter
if ($this->ctlInventoryTransact->intTransactionTypeId == 1 || $this->ctlInventoryTransact->intTransactionTypeId == 5) {
$btnRemove->ActionParameter = $objInventoryLocation->InventoryLocationId;
} elseif ($this->ctlInventoryTransact->intTransactionTypeId == 4) {
$btnRemove->ActionParameter = $objInventoryLocation->InventoryModelId;
}
$btnRemove->AddAction(new QClickEvent(), new QAjaxAction('btnRemove_Click'));
$btnRemove->AddAction(new QEnterKeyEvent(), new QAjaxAction('btnRemove_Click'));
$btnRemove->AddAction(new QEnterKeyEvent(), new QTerminateAction());
$btnRemove->CausesValidation = false;
}
return $btnRemove->Render(false);
}
示例13: render_btnRecordDelete
public function render_btnRecordDelete($parControl, Address $objRecord)
{
++$this->tempdelete;
if ($objRecord->Id == $this->intEditAddressId || $this->intEditAddressId == -1 && !$objRecord->Id) {
return null;
} else {
$strControlId = 'btnRecordDelete' . $objRecord->Id . 'dlt' . $this->tempdelete;
if (!($objControl = $this->Form->GetControl($strControlId))) {
$objControl = new QButton($parControl, $strControlId);
$objControl->Text = 'Delete';
$objControl->CssClass = 'inputbutton';
$objControl->ActionParameter = $objRecord->Id;
$objControl->AddAction(new QClickEvent(), new QConfirmAction('Are you sure ?'));
$objControl->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnRecordDelete_Click', $this->dtgAddresses->WaitIcon));
return $objControl->Render(false);
}
}
}
示例14: dtgRole_Actions_Render
public function dtgRole_Actions_Render(NarroRole $objNarroRole)
{
$strControlId = 'btnEditRole' . $objNarroRole->RoleId;
$btnEdit = $this->Form->GetControl($strControlId);
if (!$btnEdit) {
$btnEdit = new QButton($this->dtgRole, $strControlId);
$btnEdit->Text = t('Edit');
if (QApplication::$UseAjax) {
$btnEdit->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnEditRole_Click'));
} else {
$btnEdit->AddAction(new QClickEvent(), new QServerControlAction($this, 'btnEditRole_Click'));
}
}
$btnEdit->ActionParameter = $objNarroRole->RoleId;
$btnEdit->Display = QApplication::HasPermission('Can manage user roles');
$strControlId = 'btnDeleteRole' . $objNarroRole->RoleId;
$btnDelete = $this->Form->GetControl($strControlId);
if (!$btnDelete) {
$btnDelete = new QButton($this->dtgRole, $strControlId);
$btnDelete->Text = t('Delete');
$btnDelete->AddAction(new QClickEvent(), new QConfirmAction(t('Are you sure you want to delete this role?')));
if (QApplication::$UseAjax) {
$btnDelete->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnDeleteRole_Click'));
} else {
$btnDelete->AddAction(new QClickEvent(), new QServerControlAction($this, 'btnDeleteRole_Click'));
}
}
$btnDelete->ActionParameter = $objNarroRole->RoleId;
$btnDelete->Display = QApplication::HasPermission('Can manage user roles');
$strControlId = 'btnPermissions' . $objNarroRole->RoleId;
$btnPermissions = $this->Form->GetControl($strControlId);
if (!$btnPermissions) {
$btnPermissions = new QButton($this->dtgRole, $strControlId);
$btnPermissions->Text = t('Permissions');
$btnPermissions->AddAction(new QClickEvent(), new QServerControlAction($this, 'btnPermissions_Click'));
}
$btnPermissions->ActionParameter = $objNarroRole->RoleId;
$strControlId = 'btnViewUsers' . $objNarroRole->RoleId;
$btnViewUsers = $this->Form->GetControl($strControlId);
if (!$btnViewUsers) {
$btnViewUsers = new QButton($this->dtgRole, $strControlId);
$btnViewUsers->Text = t('View users');
$btnViewUsers->AddAction(new QClickEvent(), new QServerControlAction($this, 'btnViewUsers_Click'));
}
$btnViewUsers->ActionParameter = $objNarroRole->RoleId;
$strOutput = '';
if ($objNarroRole->RoleId > 5) {
$strOutput .= $btnEdit->Render(false) . ' ' . $btnDelete->Render(false) . ' ';
}
$strOutput .= $btnPermissions->Render(false) . ' ' . $btnViewUsers->Render(false);
return $strOutput;
}
示例15: RenderDelete
public function RenderDelete(GroupRegistrations $objGroupRegistration)
{
$strControlId = 'delete' . $objGroupRegistration->Id;
$btnDelete = $this->GetControl($strControlId);
if (!$btnDelete) {
$btnDelete = new QButton($this->dtgGroupRegistrations, $strControlId);
$btnDelete->Text = 'Delete';
$btnDelete->ActionParameter = $objGroupRegistration->Id;
$btnDelete->AddAction(new QClickEvent(), new QAjaxAction('btnDelete_Clicked'));
}
return $btnDelete->Render(false);
}