本文整理汇总了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();
}