Autocomplete.addTarget

Syntax

addTarget (target)

Parameters

target. JSON object that contains autocomplete parameters for specified control. The following parameters are defined:

Description

The addTarget method adds a control to autocomplete system.

Example

To execute the example, the page must contain Autocomplete component named autocomplete (seep; Autocomplete constructor). In the BODY tag add a DIV item with the example2 identifier. Add the TextBox component to autocomplete system:

autocomplete.addTarget({    
        //input box
        Control: number = new PP.Ui.TextBox({
            ParentNode: document.getElementById("example2"),
            Width: 100,
            Id: "tb"
        }),
        AlwaysShow: true,
        MinAutoFindSymbolsCount: 2,
        Active: true,
        //not case sensitive
        MatchCase: false,
        //suggestions for autocomplete
        Suggestions:
	[
	{
	    Text: "Austria"
	},
	{
	    Text: "Australia"
	},
	{
	    Text: "Andorra"
	}
	]
    }
)

After executing the example TextBox component is added to the page, autocomplete option is enabled for this component.

See also:

Autocomplete