Class \Prado\Web\UI\ActiveControls\TCallbackClientScript
The TCallbackClientScript class provides corresponding methods that can be executed on the client-side (i.e. the browser client that is viewing the page) during a callback response.
The available methods includes setting/clicking input elements, changing Css styles, hiding/showing elements, and adding visual effects to elements on the page. The client-side methods can be access through the CallbackClient property available in TPage.
For example, to hide "$myTextBox" element during callback response, do
$this->getPage()->getCallbackClient()->hide($myTextBox);
To call a specific jQuery method on an element, use the jQuery method:
// simple example: focus a textbox
$this->getCallbackClient()->jQuery($myTextBox, 'focus');
// complex example: resize a textbox using an animation
$this->getCallbackClient()->jQuery($myTextBox, 'animate', array(
array( 'width' => '+=100',
'height' => '+=50'
),
array('duration' => 1000)
));
To call a jQueryUI effect on an element, use the juiEffect method:
// simple example: focus a textbox
$this->getCallbackClient()->juiEffect($myTextBox, 'highlight');
In order to use the jQueryUI effects, the jqueryui script must be registered:
$this->getPage()->getClientScript()->registerPradoScript('jqueryui');
Class hierarchy
Author: Wei Zhuo <weizhuo[at]gmail[dot]com>Author: Fabio Bas <ctrlaltca[at]gmail[dot]com>
Since: 3.1
public
|
|
public
|
|
public
deprecated
|
|
public
|
|
public
|
appendScriptBlock(THtmlWriter $content) : mixed
Appends a block of inline javascript enclosed in a boundary.
Similar to to evaluateScript(), but functions declared in the inline block will be available to page elements. |
public
|
|
public
deprecated
|
|
public
deprecated
|
|
public
|
callClientFunction(string $function[, array<string|int, mixed> $params = [] ]) : mixed
Executes a client-side statement.
|
public
|
|
public
|
|
public
|
|
public
deprecated
|
|
public
|
evaluateScript(THtmlWriter|string $writer) : mixed
Evaluate a block of javascript enclosed in a boundary.
|
public
deprecated
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
deprecated
|
|
public
|
|
public
|
|
public
|
insertContentAfter(TControl $element, string $content) : mixed
Insert a HTML fragement after the element.
|
public
|
insertContentBefore(TControl $element, string $content) : mixed
Insert a HTML fragement in before the element.
|
public
|
jQuery(string $element, string $method[, array<string|int, mixed> $params = [] ]) : mixed
Executes a jQuery client-side method over an element.
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
raiseClientEvent(TControl $control, string $eventName) : mixed
Raise the client side event (given by $eventName) on a particular element.
|
public
|
|
public
|
removeCssClass(TControl $element, string $cssClass) : mixed
Remove a Css class name from the element.
|
public
|
replaceContent(TControl $element, string $content[, bool $self = true ]) : mixed
Replace the content of an element with new content contained in writer.
|
public
|
|
public
|
|
public
|
select(TListControl $control[, string $method = 'Value' ][, null|int|string $value = null ][, null|string $type = null ]) : mixed
Client script to select/clear/check a drop down list, check box list,
or radio button list.
The second parameter determines the selection method. Valid methods are
|
public
|
setAttribute(TControl $control, string $name, string $value) : mixed
Sets the attribute of a particular control.
|
public
|
setListItems(TControl $control, array<string|int, mixed>|TListControl $items) : mixed
Sets the options of a select input element.
|
public
deprecated
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
deprecated
|
|
public
|
|
public
|
|
public
|
|
public
deprecated
|
|
public
deprecated
|
|
public
|
|
public
|
|
public
|
visualEffect(string $type, TControl $element[, array<string|int, mixed> $options = [] ]) : mixed
Add a visual effect the element.
|
protected
|
replace(TControl $element, string $content, bool $self) : mixed
Replace the content of an element with new content. The new content can
be a string or a TControl component. If the <tt>content</tt> parameter is
a TControl component, its rendered method will be called and its contents
will be used for replacement.
|
private
|
getRenderedContentBoundary(TControl $control) : string
Renders the control and return the content boundary from
TCallbackResponseWriter. This method should only be used by framework
component developers. The render() method is defered to be called in the
TActivePageAdapter class.
|
private
|
|
private
|
|
private
|
\Prado\TApplicationComponent::FX_CACHE_FILE, \Prado\TComponent::GLOBAL_RAISE_EVENT_LISTENER |