PHP 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 {@link 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 {@link 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');
Since: 3.1
Inheritance: extends Prado\TApplicationComponent
Afficher le fichier Open project: pradosoft/prado

Méthodes publiques

Méthode Description
__construct ( ) Constructor.
addCssClass ( $element, $cssClass ) Add a Css class name to the element.
appear ( $element, $options = [] ) Alias of fadeIn()
appendContent ( $element, $content ) Append a HTML fragement to the element.
appendScriptBlock ( $content ) Appends a block of inline javascript enclosed in a boundary.
blind ( $element, $options = [] ) Visual Effect: Blind.
blindDown ( $element, $options = [] ) Alias of blind(), presets the direction to 'down'
blindUp ( $element, $options = [] ) Alias of blind(), presets the direction to 'up'
callClientFunction ( $function, $params = [] ) Executes a client-side statement.
check ( $checkbox, $checked = true ) Client script to check or uncheck a checkbox or radio button.
click ( $control ) Client script to click on an element. This client-side function is unpredictable.
drop ( $element, $options = [] ) Visual Effect: Drop out.
dropOut ( $element, $options = [] ) Alias of drop()
evaluateScript ( $writer ) Evaluate a block of javascript enclosed in a boundary.
fade ( $element, $options = [] ) Alias of fadeOut()
fadeIn ( $element, $options = [] ) Visual Effect: Gradually make the element appear.
fadeOut ( $element, $options = [] ) Visual Effect: Gradually fade the element.
fadeTo ( $element, $value, $duration = 500 ) Set the opacity on a html element or control.
focus ( $element ) Focus on a particular element.
fold ( $element, $options = [] ) Visual Effect: Fold.
getClientFunctionsToExecute ( ) : array
grow ( $element, $options = [] ) Alias of size()
hide ( $element ) Hides an element by changing its CSS display style to "none".
highlight ( $element, $options = [] ) Visual Effect: High light the element for about 2 seconds.
insertContentAfter ( $element, $content ) Insert a HTML fragement after the element.
insertContentBefore ( $element, $content ) Insert a HTML fragement in before the element.
jQuery ( $element, $method, $params = [] ) Executes a jQuery client-side method over an element.
juiEffect ( $element, $effect, $options = [] ) Add a jQuery-ui effect the element.
prependContent ( $element, $content ) Prepend a HTML fragement to the element.
puff ( $element, $options = [] ) Visual Effect: Gradually grow and fade the element.
pulsate ( $element, $options = [] ) Visual Effect: Pulsate.
raiseClientEvent ( $control, $eventName ) Raise the client side event (given by $eventName) on a particular element.
remove ( $element ) Removes an element from the HTML page.
removeCssClass ( $element, $cssClass ) Remove a Css class name from the element.
replaceContent ( $element, $content, $self = true ) Replace the content of an element with new content contained in writer.
scale ( $element, $options = [] ) Visual Effect: Scale the element.
scrollTo ( $element, $options = [] ) Scroll the top of the browser viewing area to the location of the element.
select ( $control, $method = 'Value', $value = null, $type = null ) Client script to select/clear/check a drop down list, check box list, or radio button list.
setAttribute ( $control, $name, $value ) Sets the attribute of a particular control.
setListItems ( $control, $items ) Sets the options of a select input element.
setOpacity ( $element, $value ) Alias of fadeTo()
setStyle ( $element, $styles ) Sets the style of element. The style must be a key-value array where the key is the style property and the value is the style value.
setValue ( $input, $text ) Client script to set the value of a particular input element.
shake ( $element, $options = [] ) Visual Effect: Shake the element.
show ( $element ) Shows an element by changing its CSS display style as empty.
shrink ( $element, $options = [] ) Alias of scale()
size ( $element, $options = [] ) Visual Effect: Gradually make an element grow to a predetermined size.
slideDown ( $element, $options = [] ) Visual Effect: Slide down.
slideUp ( $element, $options = [] ) Visual Effect: Slide up.
squish ( $element, $options = [] ) Alias of scale()
switchOff ( $element, $options = [] ) Alias of scale()
toggle ( $element, $effect = null, $options = [] ) Toggles the visibility of the element.
update ( $element, $content ) Update the element's innerHTML with new content.
visualEffect ( $type, $element, $options = [] ) Add a visual effect the element.

Méthodes protégées

Méthode Description
replace ( $element, $content, $self ) Replace the content of an element with new content. The new content can be a string or a TControl component. If the content parameter is a TControl component, its rendered method will be called and its contents will be used for replacement.

Private Methods

Méthode Description
getRenderedContentBoundary ( $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.
getResponseContentBoundary ( $html ) : string
getSelectionControlIsListType ( $control )
getSelectionControlType ( $control )

Method Details

__construct() public méthode

Constructor.
public __construct ( )

addCssClass() public méthode

Add a Css class name to the element.
public addCssClass ( $element, $cssClass )

appear() public méthode

Alias of fadeIn()
Deprecation: since 3.4
public appear ( $element, $options = [] )

appendContent() public méthode

Append a HTML fragement to the element.
public appendContent ( $element, $content )

appendScriptBlock() public méthode

Similar to to evaluateScript(), but functions declared in the inline block will be available to page elements.
public appendScriptBlock ( $content )

blind() public méthode

This effect needs jQueryUI.
public blind ( $element, $options = [] )

blindDown() public méthode

Alias of blind(), presets the direction to 'down'
Deprecation: since 3.4
public blindDown ( $element, $options = [] )

blindUp() public méthode

Alias of blind(), presets the direction to 'up'
Deprecation: since 3.4
public blindUp ( $element, $options = [] )

callClientFunction() public méthode

Executes a client-side statement.
public callClientFunction ( $function, $params = [] )

check() public méthode

Client script to check or uncheck a checkbox or radio button.
public check ( $checkbox, $checked = true )

click() public méthode

Client script to click on an element. This client-side function is unpredictable.
public click ( $control )

drop() public méthode

This effect needs jQueryUI.
public drop ( $element, $options = [] )

dropOut() public méthode

Alias of drop()
Deprecation: since 3.4
public dropOut ( $element, $options = [] )

evaluateScript() public méthode

Evaluate a block of javascript enclosed in a boundary.
public evaluateScript ( $writer )

fade() public méthode

Alias of fadeOut()
Deprecation: since 3.4
public fade ( $element, $options = [] )

fadeIn() public méthode

This effect doesn't need jQueryUI.
public fadeIn ( $element, $options = [] )

fadeOut() public méthode

This effect doesn't need jQueryUI.
public fadeOut ( $element, $options = [] )

fadeTo() public méthode

This effect doesn't need jQueryUI.
public fadeTo ( $element, $value, $duration = 500 )

focus() public méthode

Focus on a particular element.
public focus ( $element )

fold() public méthode

This effect needs jQueryUI.
public fold ( $element, $options = [] )

getClientFunctionsToExecute() public méthode

public getClientFunctionsToExecute ( ) : array
Résultat array list of client function to be executed during callback response.

grow() public méthode

Alias of size()
Deprecation: since 3.4
public grow ( $element, $options = [] )

hide() public méthode

Hides an element by changing its CSS display style to "none".
public hide ( $element )

highlight() public méthode

This effect needs jQueryUI.
public highlight ( $element, $options = [] )

insertContentAfter() public méthode

Insert a HTML fragement after the element.
public insertContentAfter ( $element, $content )

insertContentBefore() public méthode

Insert a HTML fragement in before the element.
public insertContentBefore ( $element, $content )

jQuery() public méthode

Executes a jQuery client-side method over an element.
public jQuery ( $element, $method, $params = [] )

juiEffect() public méthode

This method needs jQueryUI.
public juiEffect ( $element, $effect, $options = [] )

prependContent() public méthode

Prepend a HTML fragement to the element.
public prependContent ( $element, $content )

puff() public méthode

This effect needs jQueryUI.
public puff ( $element, $options = [] )

pulsate() public méthode

This effect needs jQueryUI.
public pulsate ( $element, $options = [] )

raiseClientEvent() public méthode

Raise the client side event (given by $eventName) on a particular element.
public raiseClientEvent ( $control, $eventName )

remove() public méthode

Removes an element from the HTML page.
public remove ( $element )

removeCssClass() public méthode

Remove a Css class name from the element.
public removeCssClass ( $element, $cssClass )

replace() protected méthode

Replace the content of an element with new content. The new content can be a string or a TControl component. If the content parameter is a TControl component, its rendered method will be called and its contents will be used for replacement.
See also: insertAbout
See also: insertBelow
See also: insertBefore
See also: insertAfter
protected replace ( $element, $content, $self )

replaceContent() public méthode

Replace the content of an element with new content contained in writer.
public replaceContent ( $element, $content, $self = true )

scale() public méthode

This effect needs jQueryUI.
public scale ( $element, $options = [] )

scrollTo() public méthode

Scroll the top of the browser viewing area to the location of the element.
public scrollTo ( $element, $options = [] )

select() public méthode

The second parameter determines the selection method. Valid methods are - Value, select or check by value - Values, select or check by a list of values - Index, select or check by index (zero based index) - Indices, select or check by a list of index (zero based index) - Clear, clears or selections or checks in the list - All, select all - Invert, invert the selection.
public select ( $control, $method = 'Value', $value = null, $type = null )

setAttribute() public méthode

Sets the attribute of a particular control.
public setAttribute ( $control, $name, $value )

setListItems() public méthode

Sets the options of a select input element.
public setListItems ( $control, $items )

setOpacity() public méthode

Alias of fadeTo()
Deprecation: since 3.4
public setOpacity ( $element, $value )

setStyle() public méthode

Sets the style of element. The style must be a key-value array where the key is the style property and the value is the style value.
public setStyle ( $element, $styles )

setValue() public méthode

Client script to set the value of a particular input element.
public setValue ( $input, $text )

shake() public méthode

This effect needs jQueryUI.
public shake ( $element, $options = [] )

show() public méthode

Shows an element by changing its CSS display style as empty.
public show ( $element )

shrink() public méthode

Alias of scale()
Deprecation: since 3.4
public shrink ( $element, $options = [] )

size() public méthode

This effect needs jQueryUI.
public size ( $element, $options = [] )

slideDown() public méthode

This effect doesn't need jQueryUI.
public slideDown ( $element, $options = [] )

slideUp() public méthode

This effect doesn't need jQueryUI.
public slideUp ( $element, $options = [] )

squish() public méthode

Alias of scale()
Deprecation: since 3.4
public squish ( $element, $options = [] )

switchOff() public méthode

Alias of scale()
Deprecation: since 3.4
public switchOff ( $element, $options = [] )

toggle() public méthode

Toggles the visibility of the element.
public toggle ( $element, $effect = null, $options = [] )

update() public méthode

Update the element's innerHTML with new content.
public update ( $element, $content )

visualEffect() public méthode

Add a visual effect the element.
public visualEffect ( $type, $element, $options = [] )