Эта страница является
переводом страницы
List. Перевод выполнен на 100%.
API iRidium. IR.ITEM_LISTBOX (List)
Methods to work with dynamic lists: graphic items of the List type.
List
Methods to work with lists.
IR.CreateItem()
It creates a graphic item of the List type on the current page of a project. A page can be defined with the help of IR.CurrentPage project. To create an item on any page, use CreateItem() method to a link to Page or Popup object, that is received with the help of IR.GetItem() method.
Syntax
IR.CreateItem(IR.ITEM_LISTBOX, name, X, Y, width, height);
| name
|
"Button 1"
|
type: String the name of an items, it's unique for a page.
|
| X
|
30
|
type: Number X axis coordinate.
|
| Y
|
40
|
type: Number Y axis coordinate.
|
| width
|
200
|
type: Number item width
|
| height
|
500
|
type: Number item height
|
| Object
|
[Object ListItemPrototype]
|
type: Object object of a graphic item
|
Sample
IR.AddListener(IR.EVENT_START,0, function()
{
var src = IR.CreateItem(IR.ITEM_LISTBOX,"List 1",30,40,200,500);
IR.Log(src); // [Object ListItemPrototype]
});
To create a dialog item on a particular page apply .CreateItem() to the link to the page or popup:
var list_1 = IR.GetItem("Page 1").CreateItem(IR.ITEM_LISTBOX,"List 1",30,40,200,500);
IR.Log(list_1) // [Object ListItemPrototype] // create list and get the link in one action
These are only basic properties of an item without which an item can't be created at all. All items have a common set of additional properties that are typical for a type of items. See the Properties section.
.AddItem()
It creates a list item (ListItem).
Syntax:
List.AddItem([template], [options], [customID], [position], [name]);
| On input |
Value |
Description
|
| List |
IR.GetItem("Page 1").GetItem("List") |
type: Object a link to the list object
|
| template |
List.AddItem("template", {}, cities[i]) |
type: Object the name of a template popup
|
| options |
// the name of a graphic item itemName: { // property of a graphic item: value PropertyName: Value, ... // an array of states States: [ // state property: value PropertyName: Value, ... ] |
Object an object with settings of a list item.
|
| customID |
"London" |
String ID of a list item.
|
| position |
2 |
Number position in the list.
|
| name |
"Template 1" |
String the name of a popup cloned from the template
|
| On input |
|
|
| ListItem |
[Object ListItemPrototype] |
type: Object a list item, ListItem.
|
Example
var cities = ["Moscow", "London", "New York"];
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
for(var i = 0; i < cities.length; i++)
{
var ListItem = List.AddItem("template", {}, cities[i]);
if(ListItem)
{
ListItem.SetFilterKey({"Name": cities[i]});
}
}
}
If AddItem() method is used without parameters, when the function is actiavted, a new item will be added to the list. And this item will be an exact copy of the template popup:
var List;
List = IR.GetPage("Page 1").GetItem("Item 1");
List.Template = "Popup 1";
function AddItem() {
List.AddItem();
};
.SetDataFilter()
It addes a filter by data in the key-value format.
Syntax:
List.SetDataFilter(key, value);
| On input |
Value |
Description
|
| List |
IR.GetItem("Page 1").GetItem("List") |
type: Object a link to the list object.
|
| key |
"city" |
String key.
|
| value |
"London" |
String value.
|
| On output |
|
|
| - |
|
|
Example
// search
function search(in_key, in_value)
{
if(in_key)
{
// if value is exist then set filter
if(in_value)
List.SetDataFilter(in_key, in_value);
else
// else delete filter
List.DeleteDataFilter(in_key);
// apply filter
List.ApplyDataFilter();
}
}
.ClearDataFilter()
It clears a filter by data.
Syntax:
List.ClearDataFilter()
| On input |
Value |
Description
|
| List |
IR.GetItem("Page 1").GetItem("List") |
type: Object a link to the list object.
|
| On output |
|
|
| - |
|
|
Example
// clear filter
List.ClearDataFilter();
.ApplyDataFilter()
It applies a filter by data.
Syntax:
List.ApplyDataFilter()
| On input |
Vaue |
Description
|
| List |
IR.GetItem("Page 1").GetItem("List") |
type: Object a link to the list object.
|
| On output |
|
|
| - |
|
|
Sample
// apply filter
List.ApplyDataFilter();
.DeleteDataFilter()
It deletes the key from the filter.
Synatax:
List.DeleteDataFilter(key)
| On input |
Value |
Description
|
| List |
IR.GetItem("Page 1").GetItem("List") |
type: Object a link to the list object.
|
| key |
"city" |
String key.
|
| On output |
|
|
| - |
|
|
Example
List.DeleteDataFilter("city");
.GetItemByName()
It gets ListItem by the name of a popup used in AddItem.
Syntax:
List.GetItemByName(name);
| On input |
Value |
Description
|
| List |
IR.GetItem("Page 1").GetItem("List") |
type: Object a link to the list object.
|
| name |
"Template 1" |
String the name of a popup cloned from the template.
|
| On output |
|
|
| ListItem |
[Object ListItemPrototype] |
type: Object a list item ListItem.
|
Example
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
var ListItem = List.GetItemByName("Template 1");
}
.GetItemByIndex()
It gets the ListItem by the index number.
Syntax:
List.GetItemByIndex(index)
| On input |
Value |
'Description
|
| List |
IR.GetItem("Page 1").GetItem("List") |
type: Object a link to the list object.
|
| index |
2 |
Number the index number of a list item.
|
| On output |
|
|
| ListItem |
[Object ListItemPrototype] |
type: Object a list item ListItem.
|
Example
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
var ListItem = List.GetItemByIndex(10);
}
.GetItemPositionByName()
It gets ListItem by the name of a popup used in AddItem.
Syntax:
List.GetItemPositionByName(name)
| On input |
Value |
Description
|
| List |
IR.GetItem("Page 1").GetItem("List") |
type: Object a link to the list object.
|
| name |
"Template 1" |
String the name of a popup cloned from the tempate.
|
| On output |
|
|
| Position |
2 |
Number position ListItem (number >= 0 or -1 if the item is not found).
|
Example
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
var position = List.GetItemPositionByName("Template 1");
}
.GetItemPositionByCustomID()
It gets the position of the ListItem by the entered ID.
Syntax:
List.GetItemPositionByCustomID(customId)
| On input |
Value |
Description
|
| List |
IR.GetItem("Page 1").GetItem("List") |
type: Object a link to the list object.
|
| customId |
"Moscow" |
String ID of the item list.
|
| On output |
|
|
| Position |
2 |
Number position of ListItem (number >= 0 or -1 if the item is not found).
|
Example
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
var position = List.GetItemPositionByCustomID("Moscow");
}
.GetSelected()
It gets selected itmes or an item.
Syntax:
List.GetSelected()
| On input |
Value |
Description
|
| List |
IR.GetItem("Page 1").GetItem("List") |
type: Object a link to the list object.
|
| On output |
|
|
| ListItem |
[Object ListItemPrototype] |
type: Object an array of items or an item, depending on the SelectMode of the list.
|
Example
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
var selected = List.GetSelected();
}
.ClearSelected()
It clears selected items.
Syntax:
List.ClearSelected()
| On input |
Value |
Description
|
| List |
IR.GetItem("Page 1").GetItem("List") |
type: Object a link to the lisy item.
|
| On output |
|
|
| - |
|
|
Example
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
List.ClearSelected();
}
.DeleteItemByName()
It deletes an item by the name of a popup used in AddItem.
Syntax:
List.DeleteItemByName(name)
| On input |
Value |
Description
|
| List |
IR.GetItem("Page 1").GetItem("List") |
type: Object a link to the list object.
|
| name |
"Template 1" |
String the name of a popup cloned from the template.
|
| On output |
|
|
| - |
|
|
Example
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
List.DeleteItemByName("Template 1");
}
.DeleteItemByCustomID()
It deletes an item by the entered ID.
Syntax:
List.DeleteItemByCustomID(customId)
| On input |
Value |
Description
|
| List |
IR.GetItem("Page 1").GetItem("List") |
type: Object a link to the list object.
|
| customId |
"Moscow" |
String the ID of a list item.
|
| On output |
|
|
| - |
|
|
Example
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
List.DeleteItemByCustomID("Moscow");
}
.DeleteItemByIndex()
It deletes an item by the index number.
Syntax:
List.DeleteItemByIndex(index)
| On input |
Value |
Description
|
| List |
IR.GetItem("Page 1").GetItem("List") |
type: Object a link to the list object.
|
| index |
10 |
Number the index number of a list item.
|
| On output |
|
|
| - |
|
|
Example
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
List.DeleteItemByIndex(10);
}
.DeleteItemsByName()
It deletes an item by the name of a popup used in AddItem.
Syntax:
List.DeleteItemsByName(name)
| On input |
Value |
Description
|
| List |
IR.GetItem("Page 1").GetItem("List") |
type: Object a link to the list object.
|
| name |
"Template 1" |
String the name of a popup cloned from the template.
|
| On output |
|
|
| - |
|
|
Example
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
List.DeleteItemsByName("Template 1");
}
.DeleteItemsByCustomID()
It deletes an item by the entered ID.
Syntax:
List.DeleteItemsByCustomID(customID)
| On input |
Value |
Description
|
| List |
IR.GetItem("Page 1").GetItem("List") |
type: Object a link to the list object.
|
| customId |
"Moscow" |
String the ID of a list item.
|
| On output |
|
|
| - |
|
|
Example
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
List.DeleteItemsByCustomID("Moscow");
}
.GetItemsByName()
It gets a ListItem array by the name of a popup used in AddItem.
Syntax:
List.GetItemsByName(name)
| On input |
Value |
Description
|
| List |
IR.GetItem("Page 1").GetItem("List") |
type: Object a link to the list object.
|
| name |
"Template 1" |
String the name of a popup cloned from the template.
|
| On output |
|
|
| - |
|
|
Example
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
var ListItems = List.GetItemsByName("Template 1");
}
.GetItemsByCustomID()
It gets a ListItem array by the entred ID.
Syntax:
List.GetItemsByCustomID(customID)
| On input |
Value |
Description
|
| List |
IR.GetItem("Page 1").GetItem("List") |
type: Object a link to the list object.
|
| customId |
"Moscow" |
String the ID of a list item.
|
| On output |
|
|
| - |
|
|
Example
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
var ListItems = List.GetItemsByCustomID("Moscow");
}
.SelectByIndex()
It selects an item by the index number.
Syntax:
List.SelectByIndex(index, bool)
| On input |
Value |
Description
|
| List |
IR.GetItem("Page 1").GetItem("List") |
type: Object a link to the list object.
|
| index |
10 |
Number the index number.
|
| bool |
true |
Boolean a feature of a selected item.
|
| On output |
|
|
| - |
|
|
Example
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
List.SelectByIndex(10, true);
}
.StartReleaseActionByIndex()
Do actions of an item by the index number from ListItem.SetReleaseAction.
Syntax:
List.StartReleaseActionByIndex(index)
| On input |
Value |
Description
|
| List |
IR.GetItem("Page 1").GetItem("List") |
type: Object a link to the list object.
|
| index |
10 |
Number The index number.
|
| On output |
|
|
| - |
|
|
Example
var testFunction = function(in_listItem)
{
IR.Log(in_listItem.CustomID);
}
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
var cities = ["Moscow", "London", "New York"];
if(List)
{
for(var i = 0; i < cities.length; i++)
{
var ListItem = List.AddItem("template", {}, cities[i]);
if(ListItem)
{
ListItem.SetReleaseAction(testFunction);
}
}
}
ListItem.StartReleaseActionByIndex(1); // London
}
.ScrollByName()
It srolls the list to an item used in AddItem.
Syntax:
List.ScrollByName(name)
| On input |
Value |
Description
|
| List |
IR.GetItem("Page 1").GetItem("List") |
type: Object a link to the list object.
|
| name |
"Template 1" |
String the name of a popup cloned from the template.
|
| On output |
|
|
| - |
|
|
Example
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
List.ScrollByName("Template 1");
}
.ScrollByCustomID()
It scrolls the list to an item with an entered ID.
Syntax:
List.ScrollByCustomID(customID)
| On input |
Value |
'Description
|
| List |
IR.GetItem("Page 1").GetItem("List") |
type: Object a link to the list object.
|
| customID |
"London" |
String ID of a list item.
|
| On output |
|
|
| - |
|
|
Example
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
List.ScrollByCustomID("London");
}
.ScrollByIndex()
It scrolls the list to an item with an entered index number.
Syntax:
List.ScrollByIndex(index)
| On input |
Value |
Description
|
| List |
IR.GetItem("Page 1").GetItem("List") |
type: Object a link to the list object.
|
| index |
1 |
Number the index number.
|
| On output |
|
|
| - |
|
|
Example
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
List.ScrollByIndex(1);
}
.ScrollToStart()
It scrolls the list to the beginning.
Syntax:
List.ScrollToStart()
| On input |
Value |
Description
|
| List |
IR.GetItem("Page 1").GetItem("List") |
type: Object a link to the list object.
|
| On output |
|
|
| - |
|
|
Example
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
List.ScrollToStart();
}
.ScrollToEnd()
It scrolls the list to the end.
Syntax:
List.ScrollToEnd()
| On input |
Value |
Description
|
| List |
IR.GetItem("Page 1").GetItem("List") |
type: Object a link to the list object.
|
| On output |
|
|
| - |
|
|
Example
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
List.ScrollToEnd();
}
.SetSelectFunction()
It sets a function that processes selection of a list item.
Syntax:
List.SetSelectFunction(function)
| On input |
Value |
Description
|
| List |
IR.GetItem("Page 1").GetItem("List") |
type: Object a link to the list object.
|
| function |
List.SetSelectFunction(testFunction) |
type: Object a function that is executed when ListItem is selected.
|
| On output |
|
|
| - |
|
|
Example
var testFunction = function(in_listItem)
{
IR.Log(in_listItem.CustomID); // London
}
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
var cities = ["Moscow", "London", "New York"];
if(List)
{
for(var i = 0; i < cities.length; i++)
{
var ListItem = List.AddItem("template", {}, cities[i]);
}
}
List.SetSelectFunction(testFunction);
List.SelectByIndex(1, true); // London
}
.MoveItem()
It changes the postion of a list item.
Syntax:
List.MoveItem(currentPostition, newPosition)
| On input |
Value |
Description
|
| List |
IR.GetItem("Page 1").GetItem("List") |
type: Object a link to the list object.
|
| currentPostition |
0 |
Number the current index number.
|
| newPosition |
2 |
Number the new index number.
|
| On output |
|
|
| - |
|
|
Example
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
List.MoveItem(0, 2); // change listItem from index 0 to index 2
}
.SetPosition()
It scrolls the list to the selected position. To do it, a link to the list object must be received with the help of IR.GetItem() method.
Syntax
list.SetPosition(item);
| list
|
IR.GetItem("Page 1").GetItem("Item 1")
|
type: Object a link to the list
|
| item
|
0
|
type: Number the number of a list item starting with 0.
|
-
Sample
IR.AddListener(IR.EVENT_START, 0, function()
{
var List = IR.GetItem("Page 1").GetItem("List 1");
List.SetPosition(12); // go to point
});
There are several conditions to scroll a list to a selected item:
- the item must exist;
- when the command is executed, a list must be seen, that is a page or a popup with the list must be opened;
- at least 100 msec must pass after creating a new list item. A command to scroll won't be executed right after a command to create a new list item.
.Clear()
It deletes all items from the List. To do it, a link must be received to the list object with the help of IR.GetItem() method.
Syntax
list.Clear();
| list
|
IR.GetItem("Page 1").GetItem("Item 1")
|
type: Object a link to the list
|
-
Sample
IR.AddListener(IR.EVENT_START, 0, function()
{
var List = IR.GetItem("Page 1").GetItem("List 1");
List.Clear(); // clear list
});
Properties of the List Item
Properties of items of the List type.
IR.GetItem(page/popup).GetItem(list).property
property
Get / Put:
| Template
|
"Popup 1"
|
type: string it allows to set or request a template for list items, that is one of the project popups.
|
| Direction
|
0
|
type: number it allows to set or request a direction to scroll a list:
- 0 - a vertical list;
- 1 - a horizontal list.
|
| Filter
|
"A"
|
type: string it allows to filer list items by name (part of name).
|
| ScrollEnabled
|
true
|
type: boolean it allows to turn off a capability to scroll a list manually from the interface. The .SetPosition method will continue working.
|
| DragDropEnable
|
true
|
type: boolean it allows to turn on/off drag'n'dropping list items (items change their position in a list.)
|
| Resistance
|
50
|
type: number it allows to set or request a resistance value when a list is scrolled.
|
| ScrollBar
|
true
|
type: boolean it allows to turn on/off a scroll baк (ScrollBar).
|
| SelectMode
|
IR.LIST_SELECT_SINGLE
|
type: object it allows to set or request selected list items: IR.LIST_SELECT_SINGLE - if you want to get one item, IR.LIST_SELECT_MULTIPLE - if you want to get an array of items.
|
Get:
| ItemsCount
|
24
|
type: number it allows to request the number of list items.
|
var list = IR.GetItem("Page 1").GetItem("List 1");
//** Template **//
IR.Log(list.Template); // "Popup 1"
list.Template = "Popup 2"; // change template if exist
//** Direction **//
IR.Log(list.Direction); // 1
list.Direction = 0; // change direction
//** ItemsCount **//
IR.Log(list.ItemsCount); // 24
//** Filter **//
list.Filter = "C";
IR.Log(list.Filter); // "C"
//** ScrollEnabled **//
list.ScrollEnabled = true; // list can be flipped manually
list.ScrollEnabled = false; // list cannot be flipped manually
//** DragDropEnable **//
list.DragDropEnable = true; //activate dragging list items
list.DragDropEnable = false; //deactivate dragging list items
//** Resistance **//
list.Resistance = 50; //set the scroll resistance to 50
//** ScrollBar **//
list.ScrollBar = true; //turn on the scroll bar
list.ScrollBar = false; //turn off the scroll bar
//** SelectMode **//
list.SelectMode = IR.LIST_SELECT_SINGLE; //getting one element
list.SelectMode = IR.LIST_SELECT_MULTIPLE. //getting an array of elements
ListItem
Methods to work with list items (ListItem).
.SetData()
It sets user data to a list item (data are not used for filtering).
Syntax:
ListItem.SetData(Data)
| On input |
Value |
Description
|
| ListItem |
List.GetItemByName(name) |
type: Object a link to a list item.
|
| Data |
{CountryName: "Russia", CityName: "Moscow"} |
type: Object user data as an object.
|
| On output |
|
|
| - |
|
|
Example
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
var ListItem = List.GetItemByName(name);
if(ListItem)
{
var data = {
CountryName: "Russia",
CityName: "Moscow"
}
ListItem.SetData(data);
}
}
.SetFilterKey()
It sets a flag in the key-value format to a list item for further filtering by these flags.
Syntax:
ListItem.SetFilterKey(Data)
| On input |
Value |
Description
|
| ListItem |
List.GetItemByName(name) |
type: Object a link to a list item.
|
| Data |
{"Name": cities[i]} |
type: Object user data as an object.
|
| On output |
|
|
| - |
|
|
Example
// search
function search(in_key, in_value)
{
if(in_key)
{
// if value is exist then set filter
if(in_value)
List.SetDataFilter(in_key, in_value);
else
// else delete filter
List.DeleteDataFilter(in_key);
// apply filter
List.ApplyDataFilter();
}
}
var cities = ["Moscow", "London", "New York"];
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
for(var i = 0; i < cities.length; i++)
{
var ListItem = List.AddItem("template", {}, cities[i]);
if(ListItem)
{
ListItem.SetFilterKey({"Name": cities[i]});
}
}
}
search("Name", "Mosc");
search("Name", "Lon");
// clear filter
List.ClearDataFilter();
.SetOptions()
It sets properties of a list item.
Syntax:
ListItem.SetOptions(Data)
| On input |
Value |
Description
|
| ListItem |
List.GetItemByName(name) |
type: Object a link to a list item.
|
| Data |
// the name of a graphic item itemName: { // properties of a graphic item: value PropertyName: Value, ... // an array of states States: [ // state property: value PropertyName: Value, ... ] }, ... |
type: Object an onject with settings of a list item.
|
| On output |
|
|
| - |
|
|
Example
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
var ListItem = List.GetItemByName(name);
if(ListItem)
{
ListItem.SetOptions({
"Item 1": {
Text: "SomeText",
Visible: false,
States: [{
Image: "Image 1"
}]
},
});
}
}
.SetReleaseAction()
It sets an action that must be done when an item is released.
Syntax:
ListItem.SetReleaseAction(action, [space])
| On input |
Value |
Description
|
| ListItem |
List.GetItemByName(name) |
type: Object a link to a list item.
|
| action |
function(in_listItem, in_item) { IR.Log(in_listItem.Popup.Name); IR.Log(in_item.Name); IR.Log(this.city); }
|
Object a function that is executed when a list item is released. ListItem - a list item that was pressed. Item - a dialogue item inside a list item that was pressed of the (IR.GetItem("Item")) type.
|
| [space] |
{city: "Moscow"} |
type: Object context ({}).
|
| On output |
|
|
| - |
|
|
Example
var testFunction = function(in_listItem, in_item)
{
IR.Log(in_listItem.Popup.Name);
IR.Log(in_item.Name);
IR.Log(this.city);
}
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
var ListItem = List.GetItemByName(name);
if(ListItem)
{
ListItem.SetReleaseAction(testFunction, {city: "Moscow"})
}
}
Properties of the List Item
Properties of list items:
List.GetItemByName(name).property
| List
|
IR.GetItem("Page 1").GetItem("List")
|
type: object reference to the list object.
|
| name
|
"Template 1"
|
type: string the name of a popup cloned from the template.
|
property
Get:
| Popup
|
[Object ListItemPrototype]
|
type: object It gets the popup object of the list item.
|
| Parent
|
[Object ListItemPrototype]
|
type: object It gets the List object on which ListItem is located.
|
| Data
|
{CountryName: "Russia", CityName: "Moscow"}
|
type: object It gets user data that were entered with the help of SetData() method.
|
| FilterKey
|
{"Name": cities[i]}
|
type: object It gets a flag in the key-value format of a list item, that was entered with the help of SetFilterKey() method.
|
| Index
|
1
|
type: number It gets the index number of a list item.
|
Get / Put:
| Selected
|
true
|
type: boolean a sign that an item is selected: true - an item is selected, false - an item is not selected.
|
| Context
|
{city: "Moscow"}
|
type: object the context of function that is executed in SetReleaseAction().
|
| CustomID
|
"Moscow"
|
type: string the ID of a list item.
|
| Visible
|
true
|
type: boolean visibility of a list item: true - the item is visible, false - the item is not visible in the list.
|
| Locked
|
boolean
|
type: It locks a list item in the current position (limitation of the DragDropEnable property): true - the item is locked, false - the item is not locked.
|
var List = IR.GetItem("Page 1").GetItem("List");
if(List)
{
var ListItem = List.GetItemByName(name);
if(ListItem)
{
var popup = ListItem.Popup;
var list = ListItem.Parent;
var data = ListItem.Data;
var filter = ListItem.FilterKey;
var index = ListItem.Index;
var selected = ListItem.Selected;
ListItem.Selected = !selected;
var customID = ListItem.CustomID;
ListItem.CustomID = "NewCustomID";
var context = ListItem.Context;
ListItem.Context = {city: "London"};
var visible = ListItem.Visible;
ListItem.Visible = !visible;
var locked = ListItem.Locked;
ListItem.Locked = !locked;
}
}