- Reference
- Lists
API iRidi. IR.ITEM_LISTBOX (List)
Methods for dynamic lists: graphical items of type List.
List
Methods for working with a list.
IR.CreateItem()
Create a List graphical item on the project's current page. The page can be identified using IR.CurrentPage. To create an item on a specific page, apply CreateItem() to a Page or Popup object reference obtained using IR.GetItem().
Syntax
IR.CreateItem(IR.ITEM_LISTBOX, name, X, Y, width, height);
| Input | Value | Description |
|---|---|---|
| name | "Button 1" | type: String the item name, unique within the page. |
| X | 30 | type: Number the X coordinate. |
| Y | 40 | type: Number the Y coordinate. |
| width | 200 | type: Number the item width. |
| height | 500 | type: Number the item height. |
| Output | ||
|---|---|---|
| Object | [Object ListItemPrototype] | type: Object a graphical object instance. |
Example
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 specific page, apply .CreateItem() to the page or popup reference:
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
- The constructor lists only the basic properties required to create the item. All items also have a common set of additional properties and properties specific to their type. See Properties.
.AddItem()
Create a list item (ListItem).
Syntax:
List.AddItem([template], [options], [customID], [position], [name]);
| Input | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: Object a reference to the list object |
| template | List.AddItem("template", {}, cities[i]) | type: Object the name of the popup used as a template |
| options | itemName: "Button1", PropertyName: Value, States: [{ PropertyName: Value }] | type: Object an object containing list item settings: * itemName - the graphical item name (String)* PropertyName: Value - graphical item property: value* States - an array of states, where PropertyName: Value - state property: value |
| customID | "London" | type: String the list item identifier |
| position | 2 | type: Number the position in the list |
| name | "Template 1" | type: String the name of the popup cloned from template |
| Output | ||
| ListItem | [Object ListItemPrototype] | type: Object the ListItem list item |
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", { "Name" : { Text : cities[i] }}, cities[i]);
}
}
- When the AddItem() method is called without parameters, it adds a new list item that is an exact copy of the parent item (popup):
var List;
List = IR.GetPage("Page 1").GetItem("Item 1");
List.Template = "Popup 1";
function AddItem() {
List.AddItem();
};
.SetDataFilter()
Add a key-value data filter.
Syntax:
List.SetDataFilter(key, value);
| Input | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: Object a reference to the list object |
| key | "city" | type: String the key |
| value | "London" | type: String Value |
| 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()
Clear the data filter.
Syntax:
List.ClearDataFilter()
| Input | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: Object a reference to the list object. |
| Output | - | - |
| - | - | - |
Example
// clear filter
List.ClearDataFilter();
.ApplyDataFilter()
Apply the data filter.
Syntax:
List.ApplyDataFilter()
| Input | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: Object a reference to the list object. |
| Output | - | - |
| - | - | - |
Example
// apply filter
List.ApplyDataFilter();
.DeleteDataFilter()
Delete a key from the filter.
Syntax:
List.DeleteDataFilter(key)
| Input | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: Object a reference to the list object. |
| key | "city" | String the key. |
| Output | - | - |
| - | - | - |
Example
List.DeleteDataFilter("city");
.GetItemByName()
Get a ListItem by the popup name specified when calling AddItem.
Syntax:
List.GetItemByName(name);
| Input | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: Object a reference to the list object. |
| name | "Template 1" | String the name of the popup cloned from template. |
| Output | - | - |
| ListItem | [Object ListItemPrototype] | type: Object the ListItem list item. |
Example
var List = `IR.GetItem("Page 1").GetItem("List")`;
if(List)
{
var ListItem = List.GetItemByName("Template 1");
}
.GetItemByIndex()
Get a ListItem by its index.
Syntax:
List.GetItemByIndex(index)
| Input | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: Object a reference to the list object. |
| index | 2 | Number the list item index. |
| Output | - | - |
| ListItem | [Object ListItemPrototype] | type: Object the ListItem list item. |
Example
var List = `IR.GetItem("Page 1").GetItem("List")`;
if(List)
{
var ListItem = List.GetItemByIndex(10);
}
.GetItemPositionByName()
Get the position of a ListItem by the popup name specified when calling AddItem
Syntax:
List.GetItemPositionByName(name)
| Input | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: Object a reference to the list object. |
| name | "Template 1" | String the name of the popup cloned from template. |
| Output | - | - |
| Position | 2 | Number the ListItem position (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()
Get the position of a ListItem by the specified identifier.
Syntax:
List.GetItemPositionByCustomID(customId)
| Input | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: Object a reference to the list object. |
| customId | "Moscow" | String the list item identifier. |
| Output | - | - |
| Position | 2 | Number the ListItem position (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()
Get the selected item or items.
Syntax:
List.GetSelected()
| Input | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: Object a reference to the list object. |
| Output | - | - |
| ListItem | [Object ListItemPrototype] | type: Object an array of items or a single item, depending on the list's SelectMode. |
Example
var List = `IR.GetItem("Page 1").GetItem("List")`;
if(List)
{
var selected = List.GetSelected();
}
.ClearSelected()
Clear the item selection.
Syntax:
List.ClearSelected()
| Input | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: Object a reference to the list object. |
| Output | - | - |
| - | - | - |
Example
var List = `IR.GetItem("Page 1").GetItem("List")`;
if(List)
{
List.ClearSelected();
}
.DeleteItemByName()
Delete an item by the popup name specified when calling AddItem.
Syntax:
List.DeleteItemByName(name)
| Input | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: Object a reference to the list object. |
| name | "Template 1" | String the name of the popup cloned from template. |
| Output | - | - |
| - | - | - |
Example
var List = `IR.GetItem("Page 1").GetItem("List")`;
if(List)
{
List.DeleteItemByName("Template 1");
}
.DeleteItemByCustomID()
Delete an item by the specified identifier.
Syntax:
List.DeleteItemByCustomID(customId)
| Input | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: Object a reference to the list object. |
| customId | "Moscow" | String the list item identifier. |
| Output | - | - |
| - | - | - |
Example
var List = `IR.GetItem("Page 1").GetItem("List")`;
if(List)
{
List.DeleteItemByCustomID("Moscow");
}
.DeleteItemByIndex()
Delete an item by its index.
Syntax:
List.DeleteItemByIndex(index)
| Input | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: Object a reference to the list object. |
| index | 10 | Number the list item index. |
| Output | - | - |
| - | - | - |
Example
var List = `IR.GetItem("Page 1").GetItem("List")`;
if(List)
{
List.DeleteItemByIndex(10);
}
.DeleteItemsByName()
Delete items by the popup name specified when calling AddItem.
Syntax:
List.DeleteItemsByName(name)
| Input | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: Object a reference to the list object. |
| name | "Template 1" | String the name of the popup cloned from template. |
| Output | - | - |
| - | - | - |
Example
var List = `IR.GetItem("Page 1").GetItem("List")`;
if(List)
{
List.DeleteItemsByName("Template 1");
}
.DeleteItemsByCustomID()
Delete items by the specified identifier.
Syntax:
List.DeleteItemsByCustomID(customID)
| Input | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: Object a reference to the list object. |
| customId | "Moscow" | String the list item identifier. |
| Output | - | - |
| - | - | - |
Example
var List = `IR.GetItem("Page 1").GetItem("List")`;
if(List)
{
List.DeleteItemsByCustomID("Moscow");
}
.GetItemsByName()
Get an array of ListItem objects by the popup name specified when calling AddItem.
Syntax:
List.GetItemsByName(name)
| Input | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: Object a reference to the list object. |
| name | "Template 1" | String the name of the popup cloned from template. |
| Output | - | - |
| - | - | - |
Example
var List = `IR.GetItem("Page 1").GetItem("List")`;
if(List)
{
var ListItems = List.GetItemsByName("Template 1");
}
.GetItemsByCustomID()
Get an array of ListItem objects by the specified identifier.
Syntax:
List.GetItemsByCustomID(customID)
| Input | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: Object a reference to the list object. |
| customId | "Moscow" | String the list item identifier. |
| Output | - | - |
| - | - | - |
Example
var List = `IR.GetItem("Page 1").GetItem("List")`;
if(List)
{
var ListItems = List.GetItemsByCustomID("Moscow");
}
.SelectByIndex()
Select an item by its index.
Syntax:
List.SelectByIndex(index, bool)
| Input | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: Object a reference to the list object. |
| index | 10 | Number the index. |
| bool | true | Boolean whether the item is selected. |
| Output | - | - |
| - | - | - |
Example
var List = `IR.GetItem("Page 1").GetItem("List")`;
if(List)
{
List.SelectByIndex(10, true);
}
.StartReleaseActionByIndex()
Run the action set by ListItem.SetReleaseAction for the item at the specified index.
Syntax:
List.StartReleaseActionByIndex(index)
| Input | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: Object a reference to the list object. |
| index | 10 | Number the index. |
| 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()
Scroll the list to the item specified when calling AddItem.
Syntax:
List.ScrollByName(name)
| Input | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: Object a reference to the list object. |
| name | "Template 1" | String the name of the popup cloned from template. |
| Output | - | - |
| - | - | - |
Example
var List = `IR.GetItem("Page 1").GetItem("List")`;
if(List)
{
List.ScrollByName("Template 1");
}
.ScrollByCustomID()
Scroll the list to the item with the specified identifier.
Syntax:
List.ScrollByCustomID(customID)
| Input | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: Object a reference to the list object. |
| customID | "London" | String the list item identifier. |
| Output | - | - |
| - | - | - |
Example
var List = `IR.GetItem("Page 1").GetItem("List")`;
if(List)
{
List.ScrollByCustomID("London");
}
.ScrollByIndex()
Scroll the list to the item at the specified index.
Syntax:
List.ScrollByIndex(index)
| Input | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: Object a reference to the list object. |
| index | 1 | Number the index. |
| Output | - | - |
| - | - | - |
Example
var List = `IR.GetItem("Page 1").GetItem("List")`;
if(List)
{
List.ScrollByIndex(1);
}
.ScrollToStart()
Scroll to the start of the list.
Syntax:
List.ScrollToStart()
| Input | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: Object a reference to the list object. |
| Output | - | - |
| - | - | - |
Example
var List = `IR.GetItem("Page 1").GetItem("List")`;
if(List)
{
List.ScrollToStart();
}
.ScrollToEnd()
Scroll to the end of the list.
Syntax:
List.ScrollToEnd()
| Input | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: Object a reference to the list object. |
| Output | - | - |
| - | - | - |
Example
var List = `IR.GetItem("Page 1").GetItem("List")`;
if(List)
{
List.ScrollToEnd();
}
.SetSelectFunction()
Set the handler function for list item selection.
Syntax:
List.SetSelectFunction(function)
| Input | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: Object a reference to the list object. |
| function | List.SetSelectFunction(testFunction) | type: Object the function executed when a ListItem is selected. |
| 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()
Change the position of a list item.
Syntax:
List.MoveItem(currentPostition, newPosition)
| Input | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: Object a reference to the list object. |
| currentPostition | 0 | Number the current index. |
| newPosition | 2 | Number the new index. |
| 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()
Scroll the list to the specified position. Obtain a List object reference using IR.GetItem().
Syntax
list.SetPosition(item);
| Input | Value | Description |
|---|---|---|
| list | IR.GetItem("Page 1").GetItem("Item 1") | type: Object a reference to the list. |
| item | 0 | type: Number the list item index, starting at 0. |
| Output | ||
|---|---|---|
| - |
Example
IR.AddListener(IR.EVENT_START, 0, function()
{
var List = IR.GetItem("Page 1").GetItem("List 1");
List.SetPosition(12); // go to point
});
To scroll the list to a specified item:
- the item must exist;
- the list must be visible when the command runs, meaning that the page or popup containing the list must be open;
- at least 100 ms must pass after a new list item is created; a scroll command immediately after the item creation command will not run.
.Clear()
Delete all items from a List. Obtain a List object reference using IR.GetItem().
Syntax
list.Clear();
| Input | Value | Description |
|---|---|---|
| list | IR.GetItem("Page 1").GetItem("Item 1") | type: Object a reference to the list. |
| Output | ||
|---|---|---|
| - |
Example
IR.AddListener(IR.EVENT_START, 0, function()
{
var List = IR.GetItem("Page 1").GetItem("List 1");
List.Clear(); // clear list
});
Properties of List
Properties of List graphical items:
IR.GetItem(page/popup).GetItem(list).property
property
Get / Put:
| Property | Value | Description |
|---|---|---|
| Template | "Popup 1" | type: string Sets or gets the template for list items, which is one of the project's popups. |
| Direction | 0 | type: number Sets or gets the list scrolling direction: - 0 - vertical list - 1 - horizontal list |
| Filter | "A" | type: string Filters list items by name (or part of the name). |
| ScrollEnabled | true | type: boolean Disables manual scrolling of the list in the interface. The method .SetPosition continues to work. |
| DragDropEnable | true | type: boolean Enables/disables dragging list items (items change their position in the list). |
| Resistance | 50 | type: number Sets or gets the list's scrolling resistance. |
| ScrollBar | true | type: boolean Enables/disables the scroll bar (ScrollBar). |
| SelectMode | IR.LIST_SELECT_SINGLE | type: object Selects or gets the selected list items: - IR.LIST_SELECT_SINGLE - gets one item - IR.LIST_SELECT_MULTIPLE - gets an array of items |
Get:
| Property | Value | Description |
|---|---|---|
| ItemsCount | 24 | type: number gets the number of items in the list. |
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 for working with list items (ListItem).
.SetData()
Set custom data for a list item (this data is not used for filtering).
Syntax:
ListItem.SetData(Data)
| Input | Value | Description |
|---|---|---|
| ListItem | List.GetItemByName(name) | type: Object a reference to the list item. |
| Data | {CountryName: "Russia", CityName: "Moscow"} | type: Object custom data as an object. |
| 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()
Set a key-value label for a list item so that these labels can be used for filtering.
Syntax:
ListItem.SetFilterKey(Data)
| Input | Value | Description |
|---|---|---|
| ListItem | List.GetItemByName(name) | type: Object a reference to the list item. |
| Data | {"Name": cities[i]} | type: Object custom data as an object. |
| 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()
Set list item settings.
Syntax:
ListItem.SetOptions(Data)
| Input | Value | Description |
|---|---|---|
| ListItem | List.GetItemByName(name) | type: Object a reference to the list item. |
| Data | // имя графического элементаitemName:{// свойство графического элемента: значениеPropertyName: Value,...// массив состоянийStates: [// свойство состояния: значениеPropertyName: Value,...]},... | type: Object an object containing list item settings. |
| 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()
Set the function to execute on Release.
Syntax:
ListItem.SetReleaseAction(action, [space])
| Input | Value | Description |
|---|---|---|
| ListItem | List.GetItemByName(name) | type: Object a reference to the list item. |
| action | function(in_listItem, in_item){IR.Log(in_listItem.Popup.Name);IR.Log(in_item.Name);IR.Log(this.city);} | Object the function executed on Release of a list item. ListItem is the list item that was clicked. Item is the dialog item clicked inside the list item, of the type (IR.GetItem("Item")). |
| [space] | {city: "Moscow"} | type: Object the context ( {}). |
| 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"})
}
}
ListItem properties
List item properties:
List.GetItemByName(name).property
| Property | Value | Description |
|---|---|---|
| List | IR.GetItem("Page 1").GetItem("List") | type: object a reference to the list object. |
| name | "Template 1" | type: string the name of the popup cloned from template. |
Get
| Property | Value | Description |
|---|---|---|
| Popup | [Object ListItemPrototype] | type: object get the popup object representing the list item. |
| Parent | [Object ListItemPrototype] | type: object get the List object containing the ListItem. |
| Data | {CountryName: "Russia", CityName: "Moscow"} | type: object get custom data set using SetData(). |
| FilterKey | {"Name": cities[i]} | type: object get the list item's key-value label set using SetFilterKey(). |
| Index | 1 | type: number get the list item index. |
Get / Put
| Property | Value | Description |
|---|---|---|
| Selected | true | type: boolean whether the item is selected: true - the item is selected; false - the item is not selected. |
| Context | {city: "Moscow"} | type: object the execution context for the function in SetReleaseAction(). |
| CustomID | "Moscow" | type: string the list item identifier. |
| Visible | true | type: boolean list item visibility: true - the item is visible; false - the item is not displayed in the list. |
| Locked | boolean | type: boolean locking the list item at its current position (restricting DragDropEnable): 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;
}
}