ListView

The ListView control is used to represent data in interactive hierarchical structure using different layouts or views.

Properties

animation ListViewAnimationSettings

Specifies options to customize the animation effect on adding and removing list view items.

Default: { effect: 'SlideLeft', duration: 400, easing: 'ease' }

checkBoxPosition CheckBoxPosition

Specifies the position of the checkbox.

Default: Left

cssClass AnimationSettingsModel

Specifies CSS classes to customize the appearance of the control.

Default: ""

dataStore [{}] String[] Number[] DataStore

Specifies the data store for the accordion items.

Default: []

enabled Boolean

Specifies whether the control is enabled or disabled, disabled will prevent user interaction.

Default: true

enableHtmlSanitizer Boolean

Specifies whether to allow the rendering of untrusted HTML and JavaScript values withing the control. When true, any untrusted strings or scripts will be remote before rendering.

Default: false

enableRtl Boolean

Specifies whether to render the control in right to left direction.

Default: false

enableState Boolean

Specifies whether to persist the state of the control between page loads.

The following properties will be saved to state.
  • animation
  • cssClass
  • checkBoxPosition
  • enabled
  • fields
  • headerTitle
  • height
  • htmlAttributes
  • showCheckbox
  • showIcon
  • sortOrder
  • selectedId
  • width

Default: false

enableVirtualization Boolean

Specifies whether to enable virtualization to improve the performance of the list view when loading a large amount of data.

Default: false

fields FieldSettingsModel

Specifies a template to customize the dialog's footer. When a footer template if set the buttons will not be rendered.

Default: {}

groupTemplate Function

Specifies a template to customize the appearance of the list view group header.

Default: null

headerTemplate Function

Specifies a template to customize the appearance of the list view header.

Default: null

headerTitle String

Specifies the title of the header.

Default: ""

height String Number

Specifies the height of the control in either pixels, number, or percentage.

Default: ""

htmlAttributes {:}

Specifies additional HTML attributes, such as title, styles, class, id, and name, in a key-value pair format that will be appended to the HTML element. If both the property and equivalent HTML attributes are configured, then the control overrides the property value with the HTML attributes.

Default: {}

locale String

Specifies the culture and localization value for this control, overriding the globally defined value.

Default: en-US

query Query

Specifies a query that will be executed against the data source before the data source results are bound to the control.

Default: null

showCheckbox Boolean

Specifies whether to show or hide the checkbox for list view item selection.

Default: false

showHeader Boolean

Specifies whether to show or hide the header.

Default: false

showIcon Boolean

Specifies whether to show or hide the icon the list view icon.

Default: false

sortOrder SortOrder

Specifies whether to sort the list items in order or to leave the items in the order they were added.

Default: None

template Function

Specifies a template to customize the appearance of the list view items.

Default: null

width String Number

Specifies the width of the control in either pixels, number, or percentage.

Default: 100%

Methods

addEventListener

Attaches an event handler to a specified element. This method allows you to set up a function that will be called whenever the specified event is delivered to the target element.

Parameter Type Description
eventName String A string value that specifies the name of the event.
handler Function Specifies the function to run when the event is triggered.

Returns: Void

addItem

Add new items to the list view using the given parameters.

Parameter Type Description
data [{}] Specifies an array of items to be added to the list view. Even is adding a single item, the property should be passed as an array.
fields Fields Specifies the field mappings for the text and id properties.

Returns: Void

appendTo

Appends the control to the specified HTML element.

Parameter Type Description
selector String HTMLElement The select to a specified HTML element or an HTML element where the control will be appended to.

Returns: Void

back

Navigates a nested list back one level.

Returns: Void

checkAll

Check all list view items that are not currently checked.

Returns: Void

checkItem

Check a single list item using the given parameters.

Parameter Type Description
item Fields Element HTMLElement Specifies a field item using id/text that should be unchecked or an element to uncheck.

Returns: Void

dataBind

Applies all pending property changes to the control.

Returns: Void

destroy

Destroys the Aware instance, detaches all related events, removes attributes, css classes and restores the root element.

Returns: Void

disableItem

Disable a list view item using the given parameters.

Parameter Type Description
item Fields Element HTMLElement Specifies a field item using id/text that should be disabled or an element to disable.

Returns: Void

enableItem

Enable a list view item using the given parameters.

Parameter Type Description
item Fields Element HTMLElement Specifies a field item using id/text that should be enabled or an element to enable.

Returns: Void

findItem

Find a list view item using the given parameters.

Parameter Type Description
item Fields Element HTMLElement Specifies a field item using id/text that should be found or an element to find.

Returns: SelectedItem

getLocalData

Gets the current properties values for the accordion that will be persisted to the state.

Returns: String

getRootElement

Gets the root element of the control.

Returns: HTMLElement

getSelectedItems

Gets the details of the list view items that are currently selected.

Returns: SelectedItem

getStateData

Gets the current persisted state data for the control.

Returns: String

hideItem

Hide an item from the list view using the given parameters.

Parameter Type Description
item Fields Element HTMLElement Specifies a field item using id/text that should be hidden or an element to hide.

Returns: Void

refresh

Applies all pending property changes to the accordion and re-renders the control.

Returns: Void

removeEventListener

Removes the attached event handler for the specified event listener.

Parameter Type Description
eventName String A string value that specifies the name of the event to be removed.
handler Function Specifies the function to be removed.

Returns: Void

removeItem

Remove a single item from the list view using the given parameters.

Parameter Type Description
item Fields Element HTMLElement Specifies a field item using id/text that should be removed or an element to remove.

Returns: Void

removeItems

Remove multiple items from the list view using the given parameters.

Parameter Type Description
item Fields[] Element[] HTMLElement[] Specifies a list of field items using id/text that should be selected or a list of elements to select.

Returns: Void

selectItem

Select a single list item using the given parameters.

Parameter Type Description
item Fields Element HTMLElement Specifies a field item using id/text that should be selected or an element to select.

Returns: Void

selectItems

Select a multiple list items using the given parameters.

Parameter Type Description
items Fields[] Element[] HTMLElement[] Specifies a list of field items using id/text that should be selected or a list of elements to select.

Returns: Void

showItem

Show a hidden item in the list view using the given parameters.

Parameter Type Description
item Fields Element HTMLElement Specifies a field item using id/text that should be shown or an element to show.

Returns: Void

uncheckAll

Uncheck all list view items that are currently checked.

Returns: Void

uncheckItem

Uncheck a single list item using the given parameters.

Parameter Type Description
item Fields Element HTMLElement Specifies a field item using id/text that should be unchecked or an element to uncheck.

Returns: Void

Events

actionBegin EmitType<Object>

Event callback that is raised before retrieving data from the data store.

actionComplete EmitType<Object>

Event callback that is raised after data has been retrieved from the data store.

actionFailure EmitType<Object>

Event callback that is raised when there is a failure in retrieving data from the data store.

created EmitType<CreatedEventArgs>

Event callback that is raised when the control has been created.

destroyed EmitType<Object>

Event callback that is raised when the control has been destroyed.

select EmitType<SelectEventArgs>

Event callback that is raised when a list view item is selected.