本文整理汇总了PHP中QApplication::ExecuteJavaScript方法的典型用法代码示例。如果您正苦于以下问题:PHP QApplication::ExecuteJavaScript方法的具体用法?PHP QApplication::ExecuteJavaScript怎么用?PHP QApplication::ExecuteJavaScript使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QApplication
的用法示例。
在下文中一共展示了QApplication::ExecuteJavaScript方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: txtUsername_Create
protected function txtUsername_Create()
{
$this->txtUsername = new QTextBox($this);
$this->txtUsername->Name = QApplication::Translate('Username') . ":";
$this->txtUsername->Required = true;
QApplication::ExecuteJavaScript(sprintf("document.getElementById('%s').focus()", $this->txtUsername->ControlId));
}
示例2: GetResetButtonHtml
/**
* Creates the reset button html for use with multiple select boxes.
*
*/
protected function GetResetButtonHtml()
{
$strJavaScriptOnClick = sprintf('$j("#%s").val(null);$j("#%s").trigger("change"); return false;', $this->strControlId, $this->strControlId);
$strToReturn = sprintf(' <a id="reset_ctl_%s" href="#" class="listboxReset">%s</a>', $this->strControlId, QApplication::Translate('Reset'));
QApplication::ExecuteJavaScript(sprintf('$j("#reset_ctl_%s").on("%s", function(){ %s });', $this->strControlId, "click", $strJavaScriptOnClick));
return $strToReturn;
}
示例3: SetupPanel
protected function SetupPanel()
{
if (!$this->objStack) {
return $this->ReturnTo('#1');
}
$this->btnScanCheck = new QButton($this);
$this->btnScanCheck->Text = 'Scan Check';
$this->btnScanCheck->CssClass = 'primary';
$this->btnScanCheck->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnScanCheck_Click'));
$this->dlgScanCheck = new QDialogBox($this);
$this->dlgScanCheck->Template = dirname(__FILE__) . '/dlgScanCheck.tpl.php';
$this->dlgScanCheck->MatteClickable = false;
$this->dlgScanCheck->HideDialogBox();
$this->btnScanCheckCancel = new QLinkButton($this->dlgScanCheck);
$this->btnScanCheckCancel->Text = 'Close';
$this->btnScanCheckCancel->CssClass = 'cancel';
$this->btnScanCheckCancel->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnScanCheckCancel_Click'));
$this->btnScanCheckCancel->AddAction(new QClickEvent(), new QTerminateAction());
$this->btnScanCheckTest = new QLinkButton($this->dlgScanCheck);
$this->btnScanCheckTest->Text = 'Test Connection to MICRImage';
$this->btnScanCheckTest->CssClass = 'cancel';
$this->btnScanCheckTest->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnScanCheckTest_Click'));
$this->btnScanCheckTest->AddAction(new QClickEvent(), new QTerminateAction());
$this->dtgTransactionType = new QDataGrid($this);
$this->dtgTransactionType->AddColumn(new QDataGridColumn('Transaction Type', '<?= $_CONTROL->ParentControl->RenderTransactionType($_ITEM); ?>', 'Width=280px'));
$this->dtgTransactionType->AddColumn(new QDataGridColumn('Count', '<?= $_CONTROL->ParentControl->RenderTransactionCount($_ITEM); ?>', 'Width=90px'));
$this->dtgTransactionType->SetDataBinder('dtgTransactionType_Bind', $this);
if ($this->strUrlHashArgument == 'scan') {
QApplication::ExecuteJavaScript('ScrollDivToBottom("dtgContributionsDiv");');
$this->btnScanCheck_Click();
}
}
示例4: SetupChildEditControls
protected function SetupChildEditControls()
{
$this->lstGrowthGroupLocation = $this->mctGrowthGroup->lstGrowthGroupLocation_Create();
$this->lstGrowthGroupStructure = $this->mctGrowthGroup->lstGrowthGroupStructures_Create();
$this->lstGrowthGroupStructure->Rows = 10;
$this->lstGrowthGroupStatus = new QListBox($this);
foreach (AvailabilityStatus::LoadAll() as $objStatus) {
$this->lstGrowthGroupStatus->AddItem($objStatus->Name, $objStatus->Id);
}
$this->lstGrowthGroupDayType = $this->mctGrowthGroup->lstGrowthGroupDayType_Create();
$this->txtStartTime = $this->mctGrowthGroup->txtStartTime_Create();
$this->txtEndTime = $this->mctGrowthGroup->txtEndTime_Create();
$this->txtAddress1 = $this->mctGrowthGroup->txtAddress1_Create();
$this->txtAddress2 = $this->mctGrowthGroup->txtAddress2_Create();
$this->txtCrossStreet1 = $this->mctGrowthGroup->txtCrossStreet1_Create();
$this->txtCrossStreet2 = $this->mctGrowthGroup->txtCrossStreet2_Create();
$this->txtZipCode = $this->mctGrowthGroup->txtZipCode_Create();
$this->txtLongitude = $this->mctGrowthGroup->txtLongitude_Create();
$this->txtLatitude = $this->mctGrowthGroup->txtLatitude_Create();
$this->txtAccuracy = $this->mctGrowthGroup->txtAccuracy_Create();
$this->txtAccuracy->Instructions = 'as reported by Google Maps -- this should ideally be 7';
$this->txtDescription = $this->mctGrowthGroup->txtDescription_Create();
$this->btnRefresh = new QButton($this);
$this->btnRefresh->Text = 'Lookup Using Google Maps';
$this->btnRefresh->AddAction(new QClickEvent(), new QToggleEnableAction($this->btnRefresh));
$this->btnRefresh->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnRefresh_Click'));
$this->cblMeetings = new QCheckBoxList($this, 'days');
$this->cblMeetings->Name = 'Meetings per Month';
foreach (array('1st', '2nd', '3rd', '4th', '5th', 'Every Other') as $intKey => $strName) {
$intValue = pow(2, $intKey);
$this->cblMeetings->AddItem($strName, $intValue, $this->mctGrowthGroup->GrowthGroup->MeetingBitmap & $intValue);
}
QApplication::ExecuteJavaScript('document.getElementById("days[5]").onclick = EveryOtherClicked;');
}
示例5: GetFooterRowHtml
protected function GetFooterRowHtml()
{
QApplication::ExecuteJavaScript(sprintf('highlight_datagrid(\'%s\');', $this->ControlId));
if ($this->objPaginatorAlternate) {
return sprintf('<tr><td colspan="%s">%s</td></tr>', count($this->objColumnArray), $this->GetPaginatorRowHtml($this->objPaginatorAlternate));
}
}
示例6: TextItem_Cancel
protected function TextItem_Cancel($strFormId, $strControlId, $strParameter)
{
// Hide the Textbox, get the label cleaned up and ready to go
$this->lblArray[$strParameter]->Display = true;
$this->txtArray[$strParameter]->Display = false;
$this->lblArray[$strParameter]->CssClass = 'renamer_item';
QApplication::ExecuteJavaScript('intSelectedIndex = -1;');
}
示例7: HideDialogBox
public function HideDialogBox()
{
if ($this->blnDisplay) {
$this->Display = false;
}
QApplication::ExecuteJavaScript("qc.getWrapper('" . $this->strControlId . "').hideDialogBox()");
$this->blnWrapperModified = false;
}
示例8: renderLowPriorityButton_Click
public function renderLowPriorityButton_Click($strFormId, $strControlId, $strParameter)
{
$this->intHitCnt++;
$this->dtgButtons->MarkAsModified();
QApplication::ExecuteJavaScript("alert('alert 3: a low priority script')", QJsPriority::Low);
QApplication::ExecuteJavaScript("alert('alert 1: a low priority script')", QJsPriority::Low);
QApplication::ExecuteJavaScript("alert('Just updated the datagrid: --> the javascript for adding the css class to the buttons is executed first!')", QJsPriority::Low);
QApplication::ExecuteJavaScript('$j(".ui-button").addClass("ui-state-error")');
//change the button color: this is executed with standard priority
}
示例9: GetEndScript
public function GetEndScript()
{
$strJS = parent::GetEndScript();
$strCtrlJs = <<<FUNC
\t\t\t;\$j('#{$this->ControlId}').on("sortstop", function (event, ui) {
\t\t\t\t\t\tvar ary = jQuery(this).sortable("toArray");
\t\t\t\t\t\tvar str = ary.join(",");
\t\t\t \t\t\tqcubed.recordControlModification("{$this->ControlId}", "_ItemArray", str);
\t\t\t\t\t})\t\t\t\t\t\t
FUNC;
QApplication::ExecuteJavaScript($strCtrlJs, QJsPriority::High);
return $strJS;
}
示例10: lblForgotPassword_Click
protected function lblForgotPassword_Click()
{
$this->txtUsername->Enabled = false;
$this->txtPassword->Enabled = false;
$this->btnLogin->Enabled = false;
$this->lblForgotPassword->Display = false;
$this->txtEmail->Visible = true;
$this->btnRecoverPassword->Display = true;
QApplication::ExecuteJavaScript(sprintf("if (!('placeholder' in document.createElement('input'))) qc.getC('%s').value = 'E-Mail Address'", $this->txtEmail->ControlId));
$this->txtEmail->Focus();
$this->txtEmail->Blink();
$this->txtEmail->Select();
}
示例11: Form_Create
protected function Form_Create()
{
$this->lblLabel = new QLabel($this);
$this->lblLabel->Text = "Members who left after ";
$this->dtxBeforeValue = new QDateTimeTextBox($this);
$this->dtxBeforeValue->Name = "Members who Exited Before:";
$this->dtxBeforeValue->Required = true;
$this->beforeCalValue = new QCalendar($this, $this->dtxBeforeValue);
$this->dtxBeforeValue->RemoveAllActions(QClickEvent::EventName);
$this->dtxBeforeValue->AddAction(new QChangeEvent(), new QAjaxAction('dtxDate_Change'));
$this->dtxBeforeValue->Text = QApplication::PathInfo(1);
$this->dtxAfterValue = new QDateTimeTextBox($this);
$this->dtxAfterValue->Name = "Members who exited After:";
$this->dtxAfterValue->Required = true;
$this->afterCalValue = new QCalendar($this, $this->dtxAfterValue);
$this->dtxAfterValue->RemoveAllActions(QClickEvent::EventName);
$this->dtxAfterValue->AddAction(new QChangeEvent(), new QAjaxAction('dtxDate_Change'));
$this->dtxAfterValue->Text = QApplication::PathInfo(0);
$this->dtgExitingMembers = new QDataGrid($this);
$this->dtgExitingMembers->AddColumn(new QDataGridColumn('Name', '<?= $_ITEM->Person->FullName; ?>', 'Width=270px'));
$this->dtgExitingMembers->AddColumn(new QDataGridColumn('Membership End Date', '<?= $_ITEM->DateEnd; ?>', 'Width=270px'));
$this->dtgExitingMembers->AddColumn(new QDataGridColumn('Termination Reason', '<?= $_ITEM->TerminationReason; ?>', 'Width=270px'));
$dtAfterValue = new QDateTime($this->dtxAfterValue->Text);
$dtBeforeValue = new QDateTime($this->dtxBeforeValue->Text);
$objcondition = QQ::Equal(QQN::Membership()->Person->AttributeValue->Attribute->Name, 'Post-2016');
$objMembershipArray = Membership::LoadArrayByEndDateRange($dtAfterValue, $dtBeforeValue, $objcondition);
$this->iTotalCount = count($objMembershipArray);
$this->dtgExitingMembers->DataSource = $objMembershipArray;
$chartArray = array();
$terminationReason = array();
foreach ($objMembershipArray as $member) {
if (array_key_exists($member->TerminationReason, $terminationReason)) {
$terminationReason[$member->TerminationReason]++;
} else {
$terminationReason[$member->TerminationReason] = 1;
}
}
ksort($terminationReason, SORT_STRING);
foreach ($terminationReason as $key => $value) {
$objItem = new memberArray();
$objItem->reason = $key;
$objItem->count = $value;
$chartArray[] = $objItem;
}
QApplication::ExecuteJavaScript('initializeChart(' . json_encode($chartArray) . ');');
}
示例12: dtgNew_Create
private function dtgNew_Create($latestVersions)
{
$this->dtgNew = new QDataGrid($this, 'dtgNew');
$this->dtgNew->AddColumn(new QDataGridColumn('Name', '<?= $_FORM->RenderName($_ITEM) ?>', 'HtmlEntities=false'));
$this->dtgNew->AddColumn(new QDataGridColumn('Description', '<?= $_ITEM->description ?>', 'HtmlEntities=false'));
$arrDataSource = array();
foreach ($latestVersions as $item) {
/** @var $item DownloadedItem */
if ($item->installedVersion == null) {
$arrDataSource[] = $item;
}
}
$this->dtgNew->DataSource = $arrDataSource;
if (sizeof($this->dtgNew->DataSource) > 0) {
QApplication::ExecuteJavaScript('jQuery("#lblNoNew").hide()');
} else {
QApplication::ExecuteJavaScript('jQuery("#dtgNew").hide()');
}
}
示例13: dtrGrowthGroups_Bind
public function dtrGrowthGroups_Bind()
{
$objCondition = QQ::Equal(QQN::GrowthGroup()->GrowthGroupLocationId, $this->objLocation->Id);
if ($this->lstDays->SelectedValue) {
$objCondition = QQ::AndCondition($objCondition, QQ::Equal(QQN::GrowthGroup()->GrowthGroupDayTypeId, $this->lstDays->SelectedValue));
}
if ($this->lstTypes->SelectedValue) {
$objCondition = QQ::AndCondition($objCondition, QQ::Equal(QQN::GrowthGroup()->GrowthGroupStructure->GrowthGroupStructureId, $this->lstTypes->SelectedValue));
}
// Filter Out "inactive" groups
$objCondition = QQ::AndCondition($objCondition, QQ::Equal(QQN::GrowthGroup()->Group->ActiveFlag, true));
$this->dtrGrowthGroups->DataSource = GrowthGroup::QueryArray($objCondition, QQ::OrderBy(QQN::GrowthGroup()->Group->Name));
// Results?
$this->pnlNone->Visible = !count($this->dtrGrowthGroups->DataSource);
// Markers
QApplication::ExecuteJavaScript('hideAllMarkers();');
foreach ($this->dtrGrowthGroups->DataSource as $objGroup) {
QApplication::ExecuteJavaScript('showMarker(' . ($this->intMarkerArray[$objGroup->GroupId] - 1) . ');');
}
}
示例14: RenderAsEvents
public function RenderAsEvents($strActionParameter = null, $blnDisplayOutput = true, $strTargetControlId = null, $blnRenderControlId = true)
{
if ($strTargetControlId) {
$this->strTargetControlId = $strTargetControlId;
} else {
$this->strTargetControlId = $this->objForm->GenerateControlId();
}
$this->strActionParameter = $strActionParameter;
$strToReturn = $this->GetActionAttributes();
QApplication::ExecuteJavaScript($strToReturn);
if ($blnRenderControlId && $blnDisplayOutput) {
echo sprintf("id='%s'", $this->strTargetControlId);
} else {
if ($blnRenderControlId) {
return sprintf("id='%s'", $this->strTargetControlId);
} else {
return "";
}
}
}
示例15: btnSave_Click
protected function btnSave_Click()
{
$strText = file_get_contents($this->flcUpload->FilePath);
try {
$intEntriesModified = 0;
$intEntriesAdded = 0;
$intRows = PaypalBatch::ProcessReport($strText, $intEntriesModified, $intEntriesAdded);
if (!$intEntriesAdded && !$intEntriesModified) {
QApplication::DisplayAlert('No new or modified entries found. No changes were made.');
} else {
if ($intEntriesAdded) {
QApplication::DisplayAlert(sprintf('PayPal import successful. %s payment entries were updated. WARNING: %s unlinked credit card payment entries had to be created.', $intEntriesModified, $intEntriesAdded));
} else {
QApplication::DisplayAlert(sprintf('PayPal import successful. %s payment entries were updated.', $intEntriesModified));
}
}
QApplication::ExecuteJavaScript('document.location = "/stewardship/paypal/";');
} catch (QCallerException $objExc) {
QApplication::DisplayAlert('There were problems processing the report file: "' . $objExc->getMessage() . '"');
return;
}
}