本文整理匯總了PHP中QApplication::ExecuteJavascript方法的典型用法代碼示例。如果您正苦於以下問題:PHP QApplication::ExecuteJavascript方法的具體用法?PHP QApplication::ExecuteJavascript怎麽用?PHP QApplication::ExecuteJavascript使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類QApplication
的用法示例。
在下文中一共展示了QApplication::ExecuteJavascript方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: AddControlToMove
public function AddControlToMove($objTargetControl = null)
{
$this->strJavaScripts = __JQUERY_EFFECTS__;
if ($objTargetControl && $objTargetControl->ControlId != $this->ControlId) {
QApplication::ExecuteJavascript(sprintf('var pos_%s = $j("#%s").offset()', $objTargetControl->ControlId, $objTargetControl->ControlId));
QApplication::ExecuteJavascript(sprintf('$j("#%s").on("drag", function (ev, ui) { p = $j("#%s").offset(); p.left = pos_%s.left + ui.position.left; p.top = pos_%s.top + ui.position.top; $j("#%s").offset(p); } );', $this->strControlId, $objTargetControl->ControlId, $objTargetControl->ControlId, $objTargetControl->ControlId, $objTargetControl->ControlId));
$this->objMovesControlsArray[$objTargetControl->ControlId] = true;
// TODO:
// Replace ExecuteJavascript with this:
//$this->AddAttributeScript('qcubed', 'ctrlToMove', $objTargetControl->ControlId);
}
return;
}
示例2: __set
public function __set($strName, $mixValue)
{
switch ($strName) {
case '_SelectedItems':
// Internal only. Do not use. Used by JS above to keep track of selections.
try {
$strItems = QType::Cast($mixValue, QType::String);
$this->arySelectedItems = explode(",", $strItems);
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
break;
case 'SelectedItems':
// Set the selected items to an array of object ids
try {
$aValues = QType::Cast($mixValue, QType::ArrayType);
$aJqIds = array();
foreach ($aValues as $val) {
$aJqIds[] = '"#' . $val . '"';
}
$strJqItems = join(',', $aJqIds);
$strJS = <<<FUNC
\t\t\t\t\t\t\tvar item = jQuery("#{$this->ControlId}");
\t\t\t\t\t\t\t
\t\t\t\t\t\t\tjQuery(".ui-selectee", item).each(function() {
\t\t\t\t\t\t\t\tjQuery(this).removeClass('ui-selected');
\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t
\t\t\t\t\t\t\tjQuery({$strJqItems}).each(function() {
\t\t\t\t\t\t\t\tjQuery(this).addClass('ui-selected');
\t\t\t\t\t\t\t});
FUNC;
$this->arySelectedItems = $aValues;
QApplication::ExecuteJavascript($strJS);
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
break;
default:
try {
parent::__set($strName, $mixValue);
break;
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
}
}
示例3: dtgPersonsRow_Click
public function dtgPersonsRow_Click($strFormId, $strControlId, $strParameter)
{
$intPersonId = intval($strParameter);
$objPerson = Person::Load($intPersonId);
QApplication::ExecuteJavascript("alert('You clicked on a person with ID #" . $intPersonId . ": " . $objPerson->FirstName . " " . $objPerson->LastName . "');");
}
示例4: Polling_Process
protected function Polling_Process($strFormId, $strControlId, $strParameter)
{
if ($this->strPollingMethod) {
$objObject = $this->objPollingParentObject ? $this->objPollingParentObject : $this;
$strMethod = $this->strPollingMethod;
$objObject->{$strMethod}();
QApplication::ExecuteJavascript(sprintf('qc.regPP("%s", %s);', $this->pxyPollingProxy->ControlId, $this->intPollingInterval));
}
}
示例5: chkHoldAtLocationFlag_Click
public function chkHoldAtLocationFlag_Click($strFormId, $strControlId, $strParameter)
{
if ($this->chkHoldAtLocationFlag->Checked) {
QApplication::ExecuteJavascript('document.getElementById("HAL").style.display="";');
} else {
QApplication::ExecuteJavascript('document.getElementById("HAL").style.display="none";');
}
}
示例6: RemoveAllDropZones
public function RemoveAllDropZones()
{
QApplication::ExecuteJavascript(sprintf('$j("#%s").draggable("option", "revert", "invalid");', $this->strControlId));
foreach ($this->objDropsControlsArray as $strControlId => $blnValue) {
if ($blnValue) {
$objControl = $this->objForm->GetControl($strControlId);
if ($objControl) {
$objControl->objIsDropZoneFor[$this->ControlId] = false;
}
}
}
$this->objDropsControlsArray = array();
}