A5.ListBoxremoveRows Method





The indexes and/or values to remove from the list. See A5.ListBox.getIndex.


If set to true then the list will collapse the space taken up by the removed rows before removing them from the data. This can help provied a visual indication of what was removed to the user.


Remove rows from the list.


// To get a pointer to the A5.ListBox class see {dialog.object}.getControl
// assume lObj is a pointer to an instance of the A5.ListBox class
lObj.removeRows([5,'ALFKI']); // remove the 6th item from the list as well as the item with the value of "ALFKI"

Example: Remove Rows from a List Control

The array defining the rows to delete can specify a row to delete using either the zero-based index for the row or the value returned by the list row. Both values can be combined in the same array. For example, the following JavaScript will delete the rows that return the value 'Smith' and 'Jones'. The 6th row will also be deleted:

//assume that the List was configured to return Lastname values
var _d = ['Smith','Jones',5];

//delete the row for 'Smith', 'Jones' and also the 6th row from 'list1'.
var listObj = {dialog.object}.getControl('list1');

See Also