PHP 클래스 Prado\Web\UI\WebControls\TAccordion

TAccordion displays an accordion control. Users can click on the view headers to switch among different accordion views. Each accordion view is an independent panel that can contain arbitrary content. A TAccordion control consists of one or several {@link TAccordionView} controls representing the possible accordion views. At any time, only one accordion view is visible (active), which is specified by any of the following properties: - {@link setActiveViewIndex ActiveViewIndex} - the zero-based integer index of the view in the view collection. - {@link setActiveViewID ActiveViewID} - the text ID of the visible view. - {@link setActiveView ActiveView} - the visible view instance. If both {@link setActiveViewIndex ActiveViewIndex} and {@link setActiveViewID ActiveViewID} are set, the latter takes precedence. TAccordion uses CSS to specify the appearance of the accordion headers and panel. By default, an embedded CSS file will be published which contains the default CSS for TTabPanel. You may also use your own CSS file by specifying the {@link setCssUrl CssUrl} property. The following properties specify the CSS classes used for elements in a TAccordion: - {@link setCssClass CssClass} - the CSS class name for the outer-most div element (defaults to 'accordion'); - {@link setHeaderCssClass HeaderCssClass} - the CSS class name for nonactive accordion div elements (defaults to 'accordion-header'); - {@link setActiveHeaderCssClass ActiveHeaderCssClass} - the CSS class name for the active accordion div element (defaults to 'accordion-header-active'); - {@link setViewCssClass ViewCssClass} - the CSS class for the div element enclosing view content (defaults to 'accordion-view'); When the user clicks on a view header, the switch between the old visible view and the clicked one is animated. You can use the {@link setAnimationDuration AnimationDuration} property to set the animation length in seconds; it defaults to 1 second, and when set to 0 it will produce an immediate switch with no animation. The TAccordion auto-sizes itself to the largest of all views, so it can encompass all of them without scrolling. If you want to specify a fixed height (in pixels), use the {@link setViewHeight ViewHeight} property. When a TAccordion is nested inside another, it's adviced to manually specify a {@link setViewHeight ViewHeight} for the internal TAccordion To use TAccordion, write a template like following: content for view 1 content for view 2 content for view 3
부터: 3.2
저자: Gabor Berczi, DevWorx Hungary ([email protected])
상속: extends TWebControl, implements Prado\Web\UI\IPostBackDataHandler
파일 보기 프로젝트 열기: pradosoft/prado

공개 메소드들

메소드 설명
addParsedObject ( $object ) Adds object parsed from template to the control.
getActiveHeaderCssClass ( ) : string
getActiveHeaderStyle ( ) : TStyle
getActiveView ( ) : TAccordionView Returns the currently active view.
getActiveViewID ( ) : string Returns the ID of the active accordion view.
getActiveViewIndex ( ) : integer Returns the index of the active accordion view.
getAnimationDuration ( ) : string
getCssClass ( ) : string
getCssUrl ( ) : string
getDataChanged ( ) : boolean Returns a value indicating whether postback has caused the control data change.
getHeaderCssClass ( ) : string
getHeaderStyle ( ) : TStyle
getViewCssClass ( ) : string
getViewHeight ( ) : integer
getViewStyle ( ) : TStyle
getViews ( ) : TAccordionViewCollection
loadPostData ( $key, $values ) : boolean Loads user input data.
onPreRender ( $param ) Registers CSS and JS.
raisePostDataChangedEvent ( ) Raises postdata changed event.
render ( $writer )
renderContents ( $writer ) Renders body contents of the accordion control.
setActiveHeaderCssClass ( $value )
setActiveView ( $view )
setActiveViewID ( $value )
setActiveViewIndex ( $value )
setAnimationDuration ( $value )
setCssUrl ( $value )
setHeaderCssClass ( $value )
setViewCssClass ( $value )
setViewHeight ( $value )

보호된 메소드들

메소드 설명
activateView ( $view ) Activates the specified view.
addAttributesToRender ( $writer ) Adds attributes to renderer.
createControlCollection ( ) : TAccordionViewCollection Creates a control collection object that is to be used to hold child controls
getClientClassName ( ) : string Gets the name of the javascript class responsible for performing postback for this control.
getClientOptions ( ) : array
getTagName ( ) : string
registerClientScript ( ) Registers the relevant JavaScript.
registerStyleSheet ( ) Registers the CSS relevant to the TAccordion.

메소드 상세

activateView() 보호된 메소드

If there is any other view currently active, it will be deactivated.
protected activateView ( $view )

addAttributesToRender() 보호된 메소드

Adds attributes to renderer.
protected addAttributesToRender ( $writer )

addParsedObject() 공개 메소드

This method adds only {@link TAccordionView} objects into the {@link getViews Views} collection. All other objects are ignored.
public addParsedObject ( $object )

createControlCollection() 보호된 메소드

Creates a control collection object that is to be used to hold child controls
protected createControlCollection ( ) : TAccordionViewCollection
리턴 TAccordionViewCollection control collection

getActiveHeaderCssClass() 공개 메소드

public getActiveHeaderCssClass ( ) : string
리턴 string Extra CSS class for the active header. Defaults to 'accordion-header-active'.

getActiveHeaderStyle() 공개 메소드

public getActiveHeaderStyle ( ) : TStyle
리턴 TStyle the style for the active header div

getActiveView() 공개 메소드

This method will examin the ActiveViewID, ActiveViewIndex and Views collection to determine which view is currently active. It will update ActiveViewID and ActiveViewIndex accordingly.
public getActiveView ( ) : TAccordionView
리턴 TAccordionView the currently active view, null if no active view

getActiveViewID() 공개 메소드

Note, this property may not return the correct ID. To ensure the correctness, call {@link getActiveView()} first.
public getActiveViewID ( ) : string
리턴 string The ID of the active accordion view. Defaults to '', meaning not set.

getActiveViewIndex() 공개 메소드

Note, this property may not return the correct index. To ensure the correctness, call {@link getActiveView()} first.
public getActiveViewIndex ( ) : integer
리턴 integer the zero-based index of the active accordion view. If -1, it means no active accordion view. Default is 0 (the first view is active).

getAnimationDuration() 공개 메소드

public getAnimationDuration ( ) : string
리턴 string CSS class for the currently displayed view div. Defaults to 'accordion-view'.

getClientClassName() 보호된 메소드

This method overrides the parent implementation.
protected getClientClassName ( ) : string
리턴 string the javascript class name

getClientOptions() 보호된 메소드

protected getClientOptions ( ) : array
리턴 array the options for JavaScript

getCssClass() 공개 메소드

public getCssClass ( ) : string
리턴 string CSS class for the whole accordion control div.

getCssUrl() 공개 메소드

public getCssUrl ( ) : string
리턴 string URL for the CSS file including all relevant CSS class definitions. Defaults to ''.

getDataChanged() 공개 메소드

This method is required by the \Prado\Web\UI\IPostBackDataHandler interface.
public getDataChanged ( ) : boolean
리턴 boolean whether postback has caused the control data change. False if the page is not in postback mode.

getHeaderCssClass() 공개 메소드

public getHeaderCssClass ( ) : string
리턴 string CSS class for view headers. Defaults to 'accordion-header'.

getHeaderStyle() 공개 메소드

public getHeaderStyle ( ) : TStyle
리턴 TStyle the style for all the inactive header div

getTagName() 보호된 메소드

protected getTagName ( ) : string
리턴 string tag name for the control

getViewCssClass() 공개 메소드

public getViewCssClass ( ) : string
리턴 string CSS class for the currently displayed view div. Defaults to 'accordion-view'.

getViewHeight() 공개 메소드

public getViewHeight ( ) : integer
리턴 integer Maximum height for the accordion views. If non specified, the accordion will auto-sized to the largest of all views, so it can encompass all of them without scrolling

getViewStyle() 공개 메소드

public getViewStyle ( ) : TStyle
리턴 TStyle the style for all the view div

getViews() 공개 메소드

public getViews ( ) : TAccordionViewCollection
리턴 TAccordionViewCollection list of {@link TAccordionView} controls

loadPostData() 공개 메소드

This method is primarly used by framework developers.
public loadPostData ( $key, $values ) : boolean
리턴 boolean whether the data of the control has been changed

onPreRender() 공개 메소드

This method is invoked right before the control rendering, if the control is visible.
public onPreRender ( $param )

raisePostDataChangedEvent() 공개 메소드

This method is required by {@link \Prado\Web\UI\IPostBackDataHandler} interface. It is invoked by the framework when {@link getActiveViewIndex ActiveViewIndex} property is changed on postback. This method is primarly used by framework developers.

registerClientScript() 보호된 메소드

Registers the relevant JavaScript.
protected registerClientScript ( )

registerStyleSheet() 보호된 메소드

It will register the CSS file specified by {@link getCssUrl CssUrl}. If that is not set, it will use the default CSS.
protected registerStyleSheet ( )

render() 공개 메소드

public render ( $writer )

renderContents() 공개 메소드

Renders body contents of the accordion control.
public renderContents ( $writer )

setActiveHeaderCssClass() 공개 메소드

public setActiveHeaderCssClass ( $value )

setActiveView() 공개 메소드

public setActiveView ( $view )

setActiveViewID() 공개 메소드

public setActiveViewID ( $value )

setActiveViewIndex() 공개 메소드

public setActiveViewIndex ( $value )

setAnimationDuration() 공개 메소드

public setAnimationDuration ( $value )

setCssUrl() 공개 메소드

public setCssUrl ( $value )

setHeaderCssClass() 공개 메소드

public setHeaderCssClass ( $value )

setViewCssClass() 공개 메소드

public setViewCssClass ( $value )

setViewHeight() 공개 메소드

public setViewHeight ( $value )