ListItem Constructor

Syntax

PP.Ui.ListItem(settings);

Parameters

settings. The JSON object with the values of the component properties.

Description

The ListItem constructor creates an instance of the ListItem component.

Example

To execute the example enable hyperlinks to the PP.js library and the PP.css visual styles on the HTML page. Create a list (the ListBox component), that contains three items (the ListItem components):

<div id="LB"></div>

<script type="text/javascript">

    var listitem = new PP.Ui.ListItem({//1st row

            Content: "Element1",

            RowIndex: 0,

            ColumnIndex: 0

        });

    var listitem1 = new PP.Ui.ListItem({//2nd row

            Content: "Element2",

            RowIndex: 1,

            ColumnIndex: 0,

            Selected: True//string selection

        });

    var listitem2 = new PP.Ui.ListItem({//3rd row

            Content: "Element3",

            RowIndex: 2,

            ColumnIndex: 0,

            IsVisible: False//invisible row

        });

    var listbox = new PP.Ui.ListBox({ //Create a list.

            ParentNode: document.getElementById("LB"),

            Width: 200

    });

//Add elements to the list:

    listbox.addItem(listitem);

    listbox.addItem(listitem1);

    listbox.addItem(listitem2);

    listitem.getParent().setIsRTL(True);//Return the parent component and set the IsRTL property of this component to True.

</script>

After executing the example the ListBox component that consists of three items is placed onto the HTML page. The second element is selected. The third element is invisible. The row contents is aligned to the right edge.

See also:

ListItem