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
-
QHtmlAttributeManagerBase
-
QHtmlAttributeManager
-
QControlBase
-
QControl
-
QTextBoxBase
-
QTextBox
-
QAutocompleteGen
-
QAutocompleteBase
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
Overrides
|
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
See
|
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
|
protected
|
|
public
|
|
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
|
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
Overrides
|
public
mixed
|
#
__set( string $strName, string $mixValue )
PHP __set Magic method
Parameters
- $strName
- Property Name
- $mixValue
- Property Value
Returns
mixed
Throws
Overrides
|
public
mixed
|
#
__get( string $strName )
PHP __get magic method implementation
PHP __get magic method implementation
Parameters
- $strName
- Name of the property
Returns
mixed
Throws
Overrides
|
Methods inherited from QAutocompleteGen
Close(),
Destroy(),
Disable(),
Enable(),
GetJqSetupFunction(),
GetModelConnectorParams(),
Instance(),
MakeJqOptions(),
Option(),
Option1(),
Option2(),
Option3(),
Search()
|
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()
|
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
|
#
'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
|
#
'return ("^" + $j.ui.autocomplete.escapeRegex(term));'
|
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
|
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 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
|