PHP 클래스 Prado\Web\UI\JuiControls\TJuiAutoComplete

TJuiAutoComplete is a textbox that provides a list of suggestion on the current partial word typed in the textbox. The suggestions are requested using callbacks, and raises the {@link onSuggestion OnSuggestion} event. The events of the TActiveText (from which TJuiAutoComplete is extended from) and {@link onSuggestion OnSuggestion} are mutually exculsive. That is, if {@link onTextChange OnTextChange} and/or {@link onCallback OnCallback} events are raise, then {@link onSuggestion OnSuggestion} will not be raise, and vice versa. The list of suggestions should be set in the {@link onSuggestion OnSuggestion} event handler. The partial word to match the suggestion is in the {@link TCallbackEventParameter::getCallbackParameter TCallbackEventParameter::CallbackParameter} property. The datasource of the TJuiAutoComplete must be set using {@link setDataSource} method. This sets the datasource for the suggestions repeater, available through the {@link getSuggestions Suggestions} property. Header, footer templates and other properties of the repeater can be access via the {@link getSuggestions Suggestions} property and its sub-properties. The {@link setTextCssClass TextCssClass} property if set is used to find the element within the Suggestions.ItemTemplate and Suggestions.AlternatingItemTemplate that contains the actual text for the suggestion selected. That is, only text inside elements with CSS class name equal to {@link setTextCssClass TextCssClass} will be used as suggestions. To return the list of suggestions back to the browser, supply a non-empty data source and call databind. For example, function autocomplete_suggestion($sender, $param) { $token = $param->getToken(); //the partial word to match $sender->setDataSource($this->getSuggestionsFor($token)); //set suggestions $sender->dataBind(); } The suggestion will be rendered when the {@link dataBind()} method is called during a callback request. When an suggestion is selected, that is, when the use has clicked, pressed the "Enter" key, or pressed the "Tab" key, the {@link onSuggestionSelected OnSuggestionSelected} event is raised. The {@link TCallbackEventParameter::getCallbackParameter TCallbackEventParameter::CallbackParameter} property contains the index of the selected suggestion. TJuiAutoComplete allows multiple suggestions within one textbox with each word or phrase separated by any characters specified in the {@link setSeparator Separator} property. The {@link setFrequency Frequency} and {@link setMinChars MinChars} properties sets the delay and minimum number of characters typed, respectively, before requesting for sugggestions. Use {@link onTextChange OnTextChange} and/or {@link onCallback OnCallback} events to handle post backs due to {@link setAutoPostBack AutoPostBack}. In the {@link getSuggestions Suggestions} TRepater item template, all HTML text elements are considered as text for the suggestion. Text within HTML elements with CSS class name "informal" are ignored as text for suggestions.
부터: 3.1
상속: extends Prado\Web\UI\ActiveControls\TActiveTextBox, implements Prado\Web\UI\INamingContainer, implements Prado\Web\UI\JuiControls\IJuiOptions
파일 보기 프로젝트 열기: pradosoft/prado

공개 메소드들

메소드 설명
__construct ( ) Creates a new callback control, sets the adapter to TActiveControlAdapter. If you override this class, be sure to set the adapter appropriately by, for example, by calling this constructor.
dataBind ( ) Overrides parent implementation. Callback {@link renderSuggestions()} when page's IsCallback property is true.
getFrequency ( ) : float
getMinChars ( ) : integer
getOptions ( ) : TJuiControlOptions Object containing defined javascript options
getResultPanel ( ) : TPanel
getSeparator ( ) : string
getSuggestions ( ) : TRepeater
getTextCssClass ( ) : string
getValidEvents ( ) : array() Array containing valid javascript events
getValidOptions ( ) : array() Array containing valid javascript options
getWidget ( ) : string
getWidgetID ( ) : string
onSuggest ( $param ) This method is invoked when an autocomplete suggestion is requested.
onSuggestionSelected ( $param ) This method is invoked when an autocomplete suggestion is selected.
raiseCallbackEvent ( $param ) Raises the callback event. This method is overrides the parent implementation.
renderCallback ( $writer ) Renders the suggestions during a callback respones.
renderEndTag ( $writer ) Renders the end tag and registers javascript effects library.
renderSuggestions ( $writer ) Renders the suggestions repeater.
setDataSource ( $data )
setFrequency ( $value )
setMinChars ( $value )
setSeparator ( $value )
setTextCssClass ( $value )

보호된 메소드들

메소드 설명
createRepeater ( ) : TRepeater
createResultPanel ( ) : TPanel
getClientClassName ( ) : string
getPostBackOptions ( ) : array
renderClientControlScript ( $writer ) Override parent implementation, no javascript is rendered here instead the javascript required for active control is registered in {@link addAttributesToRender}.
renderResultPanel ( $writer ) Renders the result panel.

메소드 상세

__construct() 공개 메소드

Creates a new callback control, sets the adapter to TActiveControlAdapter. If you override this class, be sure to set the adapter appropriately by, for example, by calling this constructor.
public __construct ( )

createRepeater() 보호된 메소드

protected createRepeater ( ) : TRepeater
리턴 Prado\Web\UI\WebControls\TRepeater new instance of TRepater to render the list of suggestions.

createResultPanel() 보호된 메소드

protected createResultPanel ( ) : TPanel
리턴 Prado\Web\UI\WebControls\TPanel new instance of result panel. Default uses TPanel.

dataBind() 공개 메소드

Overrides parent implementation. Callback {@link renderSuggestions()} when page's IsCallback property is true.
public dataBind ( )

getClientClassName() 보호된 메소드

protected getClientClassName ( ) : string
리턴 string corresponding javascript class name for this TActiveButton.

getFrequency() 공개 메소드

public getFrequency ( ) : float
리턴 float maximum delay (in seconds) before requesting a suggestion.

getMinChars() 공개 메소드

public getMinChars ( ) : integer
리턴 integer minimum number of characters before requesting a suggestion.

getOptions() 공개 메소드

Object containing defined javascript options
public getOptions ( ) : TJuiControlOptions
리턴 TJuiControlOptions

getPostBackOptions() 보호된 메소드

protected getPostBackOptions ( ) : array
리턴 array list of callback options.

getResultPanel() 공개 메소드

public getResultPanel ( ) : TPanel
리턴 Prado\Web\UI\WebControls\TPanel suggestion results panel.

getSeparator() 공개 메소드

public getSeparator ( ) : string
리턴 string word or token separators (delimiters).

getSuggestions() 공개 메소드

public getSuggestions ( ) : TRepeater
리턴 Prado\Web\UI\WebControls\TRepeater suggestion list repeater

getTextCssClass() 공개 메소드

public getTextCssClass ( ) : string
리턴 string Css class name of the element to use for suggestion.

getValidEvents() 공개 메소드

Array containing valid javascript events
public getValidEvents ( ) : array()
리턴 array()

getValidOptions() 공개 메소드

Array containing valid javascript options
public getValidOptions ( ) : array()
리턴 array()

getWidget() 공개 메소드

public getWidget ( ) : string
리턴 string the name of the jQueryUI widget method

getWidgetID() 공개 메소드

public getWidgetID ( ) : string
리턴 string the clientid of the jQueryUI widget element

onSuggest() 공개 메소드

The method raises 'OnSuggest' event. If you override this method, be sure to call the parent implementation so that the event handler can be invoked.
public onSuggest ( $param )

onSuggestionSelected() 공개 메소드

The method raises 'OnSuggestionSelected' event. If you override this method, be sure to call the parent implementation so that the event handler can be invoked.
public onSuggestionSelected ( $param )

raiseCallbackEvent() 공개 메소드

If {@link setAutoPostBack AutoPostBack} is enabled it will raise {@link onTextChanged OnTextChanged} event event and then the {@link onCallback OnCallback} event. The {@link onSuggest OnSuggest} event is raise if the request is to find sugggestions, the {@link onTextChanged OnTextChanged} and {@link onCallback OnCallback} events are NOT raised. This method is mainly used by framework and control developers.
public raiseCallbackEvent ( $param )

renderCallback() 공개 메소드

Renders the suggestions during a callback respones.
public renderCallback ( $writer )

renderClientControlScript() 보호된 메소드

Override parent implementation, no javascript is rendered here instead the javascript required for active control is registered in {@link addAttributesToRender}.
protected renderClientControlScript ( $writer )

renderEndTag() 공개 메소드

Renders the end tag and registers javascript effects library.
public renderEndTag ( $writer )

renderResultPanel() 보호된 메소드

Renders the result panel.
protected renderResultPanel ( $writer )

renderSuggestions() 공개 메소드

Renders the suggestions repeater.
public renderSuggestions ( $writer )

setDataSource() 공개 메소드

public setDataSource ( $data )

setFrequency() 공개 메소드

public setFrequency ( $value )

setMinChars() 공개 메소드

public setMinChars ( $value )

setSeparator() 공개 메소드

public setSeparator ( $value )

setTextCssClass() 공개 메소드

public setTextCssClass ( $value )