PHP Класс 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');
С версии: 3.1
Наследование: extends Prado\TApplicationComponent
Показать файл Открыть проект

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
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.

Приватные методы

Метод Описание
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 )

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( )

addCssClass() публичный Метод

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

appear() публичный Метод

Alias of fadeIn()
Устаревший: since 3.4
public appear ( $element, $options = [] )

appendContent() публичный Метод

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

appendScriptBlock() публичный Метод

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

blind() публичный Метод

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

blindDown() публичный Метод

Alias of blind(), presets the direction to 'down'
Устаревший: since 3.4
public blindDown ( $element, $options = [] )

blindUp() публичный Метод

Alias of blind(), presets the direction to 'up'
Устаревший: since 3.4
public blindUp ( $element, $options = [] )

callClientFunction() публичный Метод

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

check() публичный Метод

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

click() публичный Метод

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

drop() публичный Метод

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

dropOut() публичный Метод

Alias of drop()
Устаревший: since 3.4
public dropOut ( $element, $options = [] )

evaluateScript() публичный Метод

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

fade() публичный Метод

Alias of fadeOut()
Устаревший: since 3.4
public fade ( $element, $options = [] )

fadeIn() публичный Метод

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

fadeOut() публичный Метод

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

fadeTo() публичный Метод

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

focus() публичный Метод

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

fold() публичный Метод

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

getClientFunctionsToExecute() публичный Метод

public getClientFunctionsToExecute ( ) : array
Результат array list of client function to be executed during callback response.

grow() публичный Метод

Alias of size()
Устаревший: since 3.4
public grow ( $element, $options = [] )

hide() публичный Метод

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

highlight() публичный Метод

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

insertContentAfter() публичный Метод

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

insertContentBefore() публичный Метод

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

jQuery() публичный Метод

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

juiEffect() публичный Метод

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

prependContent() публичный Метод

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

puff() публичный Метод

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

pulsate() публичный Метод

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

raiseClientEvent() публичный Метод

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

remove() публичный Метод

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

removeCssClass() публичный Метод

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

replace() защищенный Метод

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.
См. также: insertAbout
См. также: insertBelow
См. также: insertBefore
См. также: insertAfter
protected replace ( $element, $content, $self )

replaceContent() публичный Метод

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

scale() публичный Метод

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

scrollTo() публичный Метод

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

select() публичный Метод

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() публичный Метод

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

setListItems() публичный Метод

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

setOpacity() публичный Метод

Alias of fadeTo()
Устаревший: since 3.4
public setOpacity ( $element, $value )

setStyle() публичный Метод

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() публичный Метод

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

shake() публичный Метод

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

show() публичный Метод

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

shrink() публичный Метод

Alias of scale()
Устаревший: since 3.4
public shrink ( $element, $options = [] )

size() публичный Метод

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

slideDown() публичный Метод

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

slideUp() публичный Метод

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

squish() публичный Метод

Alias of scale()
Устаревший: since 3.4
public squish ( $element, $options = [] )

switchOff() публичный Метод

Alias of scale()
Устаревший: since 3.4
public switchOff ( $element, $options = [] )

toggle() публичный Метод

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

update() публичный Метод

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

visualEffect() публичный Метод

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