ArrayStore

If you want to extend the functionality of a JavaScript array, place it into an ArrayStore. It provides an interface for loading and editing data, and allows you to handle data-related events.

JavaScript
$(function() {
    $("#listContainer").dxList({
        dataSource: new DevExpress.data.ArrayStore({
            data: fruits,
            onLoaded: function() {
                // Event handling commands go here
            }
        }),
        itemTemplate: function(data, _, element) {
            element.append(
                $("<b>").text(data.fruit), $("<br />"),
                $("<p>").text(data.count).css("margin", 0)
            )
        }
    });
});

Data kept in an ArrayStore can be processed in the DataSource. Its purpose is similar to that of the Query, but DataSource provides wider capabilities. For example, the DataSource can map objects from the array that underlies the ArrayStore, as shown in the following code where the resulting objects match the default item template.

JavaScript
var fruits = [
    { fruit: "Apples", count: 10 },
    // ...
];

$(function() {
    $("#listContainer").dxList({
        dataSource: new DevExpress.data.DataSource({
            store: fruits,
            map: function(item) {
                return {
                    text: item.fruit,
                    badge: item.count
                }   
            }
        })
    });
});
NOTE
Even if you have passed a JavaScript array to the dataSource option, the List automatically places it into an ArrayStore wrapped into the DataSource that you can get with the getDataSource() method.
See Also