Overview

Packages

  • Actions
  • Codegen
  • Controls
    • Base
  • DatabaseAdapters
  • Events
  • None
  • Sessions
  • Tests

Classes

  • QAccordionBase
  • QAccordionGen
  • QAutocompleteBase
  • QAutocompleteGen
  • QDatepickerBase
  • QDatepickerBoxBase
  • QDatepickerBoxGen
  • QDatepickerGen
  • QDialogBase
  • QDialogGen
  • QDraggableBase
  • QDraggableGen
  • QDroppableBase
  • QDroppableGen
  • QFieldset
  • QJqButtonBase
  • QJqButtonGen
  • QJqCheckBoxBase
  • QJqCheckBoxGen
  • QJqRadioButtonBase
  • QJqRadioButtonGen
  • QMenuBase
  • QMenuGen
  • QProgressbarBase
  • QProgressbarGen
  • QResizableBase
  • QResizableGen
  • QSelectableBase
  • QSelectableGen
  • QSelectMenu
  • QSelectMenuBase
  • QSelectMenuGen
  • QSliderBase
  • QSliderGen
  • QSortableBase
  • QSortableGen
  • QSpinnerBase
  • QSpinnerGen
  • QTabsBase
  • QTabsGen
  • QTextBoxBase
  • Overview
  • Package
  • Class

Class QAutocompleteBase

Implements the JQuery UI Autocomplete widget

The Autocomplete is JQuery UIs version of a field with an attached drop down menu. As you type in the field, the menu appears, and the items in the menu are filtered by what the user types. This class allows you to use an array of QListItems, or an array of database objects as the source. You can also pass this array statically in the Source parameter at creation time, or dynamically via Ajax by using SetDataBinder, and then in your data binder function, setting the DataSource parameter.

QBaseClass
Extended by QHtmlAttributeManagerBase
Extended by QHtmlAttributeManager
Extended by QControlBase
Extended by QControl
Extended by QTextBoxBase
Extended by QTextBox
Extended by QAutocompleteGen
Extended by QAutocompleteBase

Direct known subclasses

QAutocomplete
Package: Controls\Base
Link: http://jqueryui.com/autocomplete/
Located at includes/base_controls/QAutocompleteBase.class.php
Methods summary
public
# __construct( QControl|QForm $objParentObject, null|string $strControlId = null )

Constructor for the QTextBox[Base]

Constructor for the QTextBox[Base]

Parameters

$objParentObject
$strControlId

Throws

Exception|QCallerException

Overrides

QTextBoxBase::__construct()
public static
# UseFilter( string|QJsClosure $filter )

Set a filter to use when using a simple array as a source (in non-ajax mode). Note that ALL non-ajax autocompletes on the page will use the new filter.

Set a filter to use when using a simple array as a source (in non-ajax mode). Note that ALL non-ajax autocompletes on the page will use the new filter.

Parameters

$filter

represents a closure that will be used as the global filter function for jQuery autocomplete. The closure should take two arguments - array and term. array is the list of all available choices, term is what the user typed in the input box. It should return an array of suggestions to show in the drop-down. Example:

QAutocomplete::UseFilter(QAutocomplete::FILTER_STARTS_WITH)

Throws

QCallerException

See

QAutocompleteBase::FILTER_CONTAINS
QAutocompleteBase::FILTER_STARTS_WITH
public
# SetDataBinder( string $strMethodName, QForm|QControl $objParentControl = null )

Set the data binder for ajax filtering

Set the data binder for ajax filtering

Call this at creation time to set the data binder of the item list you will display. The data binder will be an AjaxAction function, and so will receive the following parameters: - FormId - ControlId - Parameter The Parameter in particular will be the term that you should use for filtering. There are situations where the term will not be the same as the contents of the field.

Parameters

$strMethodName
Name of the method which has to be bound
$objParentControl
The parent control on which the action is to be bound
public string
# GetEndScript( )

Gets the Javascript part of the control which is sent to the client side upon the completion of Render

Gets the Javascript part of the control which is sent to the client side upon the completion of Render

Returns

string
The JS string

Overrides

QAutocompleteGen::GetEndScript()
protected
# prepareAjaxList( $dataSource )
public
# SetEmpty( )
protected mixed
# GetState( )

Control subclasses should return their state data that they will use to restore later.

Control subclasses should return their state data that they will use to restore later.

Returns

mixed

Overrides

QTextBoxBase::GetState()
protected
# PutState( mixed $state )

Restore the state of the control. The control will have already been created and initialized. Subclasses should verify that the restored state is still valid for the data available.

Restore the state of the control. The control will have already been created and initialized. Subclasses should verify that the restored state is still valid for the data available.

Parameters

$state

Overrides

QTextBoxBase::PutState()
public mixed
# __set( string $strName, string $mixValue )

PHP __set Magic method

PHP __set Magic method

Parameters

$strName
Property Name
$mixValue
Property Value

Returns

mixed

Throws

Exception|QInvalidCastException

Overrides

QAutocompleteGen::__set()
public mixed
# __get( string $strName )

PHP __get magic method implementation

PHP __get magic method implementation

Parameters

$strName
Name of the property

Returns

mixed

Throws

Exception|QCallerException

Overrides

QAutocompleteGen::__get()
Methods inherited from QAutocompleteGen
Close(), Destroy(), Disable(), Enable(), GetJqSetupFunction(), GetModelConnectorParams(), Instance(), MakeJqOptions(), Option(), Option1(), Option2(), Option3(), Search()
Methods inherited from QTextBoxBase
GetControlHtml(), InitHtmlPurifier(), ParsePostData(), RenderHtmlAttributes(), Sanitize(), Select(), SetPurifierConfig(), Validate()
Methods inherited from QControlBase
AddAction(), AddActionArray(), AddAttributeScript(), AddChildControl(), AddCssFile(), AddJavascriptFile(), AddPluginCssFile(), AddPluginJavascriptFile(), AddWrapperCssClass(), Blink(), EvaluateTemplate(), Focus(), ForgetState(), GetAllActions(), GetAttributes(), GetChildControl(), GetChildControls(), GetControlFromHierarchyByMethodName(), GetCustomAttribute(), GetCustomAttributes(), GetCustomStyle(), GetEndHtml(), GetForm(), GetJavaScriptForEvent(), GetJqControlId(), GetNonWrappedHtml(), GetStyleAttributes(), GetTemplatePath(), GetWrapperAttributes(), GetWrapperStyleAttributes(), GetWrapperStyler(), IsDescendantOf(), IsModified(), MakeCurrent(), MarkAsModified(), MarkAsRendered(), MarkAsWrapperModified(), ProcessActionParameters(), Refresh(), RemoveAllActions(), RemoveChildControl(), RemoveChildControls(), RemoveCustomAttribute(), RemoveCustomStyle(), RemoveWrapperCssClass(), Render(), RenderActionScripts(), RenderAjax(), RenderAttributeScripts(), RenderChildren(), RenderComment(), RenderCssStyles(), RenderExtensionRenderer(), RenderHelper(), RenderOutput(), RenderWithError(), RenderWithName(), RenderWrappedOutput(), ResetFlags(), ResetOnPageStatus(), SetCustomAttribute(), SetCustomStyle(), SetFocus(), SetForm(), SetParentControl(), Sleep(), SleepHelper(), ValidateControlAndChildren(), ValidationReset(), VarExport(), Wakeup(), WakeupHelper(), Watch(), _CallActionMethod(), _ProcessActionParams(), _ReadState(), _WriteState()
Methods inherited from QHtmlAttributeManagerBase
AddCssClass(), GetCssStyle(), GetDataAttribute(), GetHtmlAttribute(), GetHtmlAttributes(), HasCssClass(), HasCssStyle(), HasHtmlAttribute(), Override(), RemoveCssClass(), RemoveCssClassesByPrefix(), RemoveCssStyle(), RemoveDataAttribute(), RemoveHtmlAttribute(), RenderTag(), SetCssBoxValue(), SetCssClass(), SetCssStyle(), SetDataAttribute(), SetHtmlAttribute()
Methods inherited from QBaseClass
OverrideAttributes(), __call()
Constants summary
string FILTER_CONTAINS

When this filter is passed to QAutocomplete::UseFilter, only the items in the source list that contain the typed term will be shown in the drop-down This is the default filter used by the jQuery autocomplete. Useful when resetting from a previousely set filter.

When this filter is passed to QAutocomplete::UseFilter, only the items in the source list that contain the typed term will be shown in the drop-down This is the default filter used by the jQuery autocomplete. Useful when resetting from a previousely set filter.

See

QAutocompleteBase::UseFilter()
# 'return $j.ui.autocomplete.escapeRegex(term);'
string FILTER_STARTS_WITH

When this filter is passed to QAutocomplete::UseFilter, only the items in the source list that begin with the typed term will be shown in the drop-down

When this filter is passed to QAutocomplete::UseFilter, only the items in the source list that begin with the typed term will be shown in the drop-down

See

QAutocompleteBase::UseFilter()
# 'return ("^" + $j.ui.autocomplete.escapeRegex(term));'
Constants inherited from QControlBase
CommentEnd, CommentStart
Properties summary
protected string $strSelectedId
# null
protected boolean $blnUseAjax
# false
Properties inherited from QAutocompleteGen
$blnAutoFocus, $blnDisabled, $intDelay, $intMinLength, $mixAppendTo, $mixPosition, $mixSource, $strJavaScripts, $strStyleSheets
Properties inherited from QTextBox
$strCssClass
Properties inherited from QTextBoxBase
$blnAutoTrim, $intColumns, $intMaxLength, $intRows, $intSanitizeFilter, $intValidateFilter, $mixSanitizeFilterOptions, $mixValidateFilterOptions, $objHTMLPurifierConfig, $strCrossScripting, $strFormat, $strLabelForInvalid, $strLabelForRequired, $strLabelForRequiredUnnamed, $strLabelForTooLong, $strLabelForTooLongUnnamed, $strLabelForTooShort, $strLabelForTooShortUnnamed, $strPlaceholder, $strText, $strTextMode
Properties inherited from QControlBase
$blnActionsMustTerminate, $blnAutoRender, $blnDisplay, $blnIsBlockElement, $blnMinimize, $blnModified, $blnOnPage, $blnRendered, $blnRendering, $blnRequired, $blnSaveState, $blnScriptsOnly, $blnUseWrapper, $blnVisible, $blnWrapLabel, $blnWrapperModified, $mixActionParameter, $mixCausesValidation, $objActionArray, $objChildControlArray, $objDraggable, $objDroppable, $objForm, $objLinkedNode, $objParentControl, $objResizable, $objWatcher, $objWrapperStyler, $strAttributeScripts, $strControlId, $strCustomAttributeArray, $strCustomStyleArray, $strFormAttributes, $strHtmlAfter, $strHtmlBefore, $strInstructions, $strName, $strPreferredRenderMethod, $strRenderMethod, $strValidationError, $strWarning
Properties inherited from QHtmlAttributeManagerBase
$attributes, $styles
Magic properties summary
public string $SelectedId

the id of the selected item. When QAutocompleteListItem objects are used for the DataSource, this corresponds to the Value of the item

public boolean $MustMatch

if true, non matching values are not accepted by the input

public string $MultipleValueDelimiter

if set, the Autocomplete will keep appending the new selections to the previous term, delimited by this string. This is useful when making QAutocomplete handle multiple values (see http://jqueryui.com/demos/autocomplete/#multiple ).

public boolean $DisplayHtml

if set, the Autocomplete will treat the 'label' portion of each data item as Html.

public write-only array $Source

an array of strings, QListItem's, or data objects. To be used at creation time. {@inheritdoc }

public write-only array $DataSource

an array of strings, QListItem's, or data objects

Magic properties inherited from QAutocompleteGen
$AppendTo, $AutoFocus, $Delay, $Disabled, $MinLength, $Position
Magic properties inherited from QTextBoxBase
$AutoTrim, $Columns, $CrossScripting, $Format, $LabelForInvalid, $LabelForRequired, $LabelForRequiredUnnamed, $LabelForTooLong, $LabelForTooLongUnnamed, $LabelForTooShort, $LabelForTooShortUnnamed, $MaxLength, $Placeholder, $Rows, $SanitizeFilter, $SanitizeFilterOptions, $Text, $TextMode, $ValidateFilter, $ValidateFilterOptions, $Value
Magic properties inherited from QControlBase
$ActionParameter, $ActionsMustTerminate, $AutoRender, $CausesValidation, $ControlId, $Form, $FormAttributes, $HtmlAfter, $HtmlBefore, $Instructions, $JavaScripts, $LinkedNode, $Minimize, $Modified, $Moveable, $Name, $OnPage, $ParentControl, $PreferredRenderMethod, $RenderMethod, $Rendered, $Rendering, $Required, $Resizable, $SaveState, $ScriptsOnly, $StyleSheets, $UseWrapper, $ValidationError, $Visible, $Warning, $WrapLabel, $WrapperCssClass, $WrapperModified
Magic properties inherited from QHtmlAttributeManagerBase
$AccessKey, $AltText, $BackColor, $BorderCollapse, $BorderColor, $BorderStyle, $BorderWidth, $CssClass, $Cursor, $Data, $Display, $DisplayStyle, $Enabled, $FontBold, $FontItalic, $FontNames, $FontOverline, $FontSize, $FontStrikeout, $FontUnderline, $ForeColor, $Height, $HorizontalAlign, $Left, $Margin, $NoWrap, $Opacity, $OrderedListType, $Overflow, $Padding, $ReadOnly, $TabIndex, $ToolTip, $Top, $UnorderedListStyle, $VerticalAlign, $Width
API documentation generated by ApiGen