ComboBox.filterByText

Syntax

filterByText (value);

Parameters

value. Filter line.

Description

The filterByText method filtrates items by a line.

Comments

The method is relevant if the ComboBox.AutoFind property is set to False.

Example

To execute the example, connect the PP.js library and the PP.js visual styles table. Create the field for entering the text with the Text1 identifier and the button named Filter on pressing the last the Filter function is executed.

<div id="cmb"></div><!--ComboBox component-->

<div>

<input type="text" id="Text1" /><!--Text box-->

<input type="button" id="Button2" value="Filter" onclick="Filter();" /><!--Button

to run filtering-->

</div>

<script type="text/javascript">

function Filter()//Function that filtrates the list elements by a line

{

comboBox.filterByText(document.getElementById("Text1").value);

}

var comboBox = new PP.Ui.ComboBox

({ ParentNode: document.getElementById("cmb"),

ListBox: { Items: [//List elements

{ Content: "false" },

{ Content: "true" },

{ Content: Money },

{ Content: Financial },

{ Content: Data short format },

{ Content: Data long format }

]},

Width: 200,

AutoFind: false});//Disable the autofind

</script>

After executing the example the ComboBox component, Filter button and a text entry box are placed in HTML page. Enter the English letter E to the text field and press the Filter button:

Then open the list of the elements. Two values are set in the item list: true and false:

See also:

ComboBox