An array of items displayed by the UI component.
The items array can contain:
If you need to update the UI component items, reassign the entire items array as shown in the following example:
listInstance.option('items', newItems);
As an alternative to items, you can use the dataSource property. It accepts the DataSource object, whose underlying stores provide an API that allows you to update individual items without reassigning the entire item collection.
Do not use the items property if you use dataSource, and vice versa.
Specifies the text of a badge displayed for the list item.
If the property value is undefined or an empty string, the badge is not displayed.
Specifies whether the UI component item responds to user interaction.
Specifies the HTML markup to be inserted into the item element.
The List component evaluates the html property's value. This evaluation, however, makes the List potentially vulnerable to XSS attacks. To guard against these attacks, encode the HTML markup before you assign it to the html property. Refer to the following help topic for more information: Potentially Vulnerable API - html.
You can use the text property as a safe alternative.
Specifies the list item's icon.
Specifies the name of the list items group in a grouped list.
Specifies whether or not to display a chevron for the list item.
Specifies a template that should be used to render this item only.
jQueryThe following types of the specified value are available.
The following example adds a custom item to the component.
$(function() { $("#listContainer").dxList({ // ... items: [ { // ... template: '<div>Custom Item</div>' } ] }); });Angular
The following types of the specified value are available.
The following example adds a custom item to the component. Note that Angular uses custom templates instead of the template property.
<dx-list ... > <dxi-item ... > <div *dxTemplate> <div>Custom Item</div> </div> </dxi-item> </dx-list>
import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { // ... }
import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { AppComponent } from './app.component'; import { DxListModule } from 'devextreme-angular'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, DxListModule ], providers: [ ], bootstrap: [AppComponent] }) export class AppModule { }Vue
The following types of the specified value are available.
The following example adds a custom item to the component. Note that Vue uses custom templates instead of the template property.
<template> <DxList ... > <dxItem ... > <div>Custom Item</div> </dxItem> </DxList> </template> <script> import DxList, { DxItem } from 'devextreme-vue/list'; export default { components: { DxList, DxItem }, // ... } </script>React
The following types of the specified value are available.
The following example adds a custom item to the component. In React, specify the render or component properties.
import React from 'react'; import List, { Item } from 'devextreme-react/list'; const renderCustomItem = () => { return <div>Custom Item</div>; } const App() = () => { return ( <List ... > <Item ... render={renderCustomItem} > </Item> </List> ); } export default App;See Also
Specifies text displayed for the UI component item.
If you use both this property and a template, the template overrides the text.
Specifies whether or not a UI component item must be displayed.
Feel free to share topic-related thoughts here.RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4