Array Only

To bind the TreeList to an array, pass this array to the dataSource option.

JavaScript
var employees = [
    { id: '1', fullName: "John Heart", position: "CEO" }, 
    { id: '1_1', parentId: '1', fullName: "Samantha Bright",  position: "COO" }, 
    { id: '2_1', parentId: '2', fullName: "Robert Reagan", position: "CMO" }, 
    { id: '2', fullName: "Greta Sims", position: "HR Manager" }
];

$(function(){
    $("#treeListContainer").dxTreeList({
        dataSource: employees
    });
});

View Demo

If objects in the array need to be processed (sorted or filtered), you can create a Query. For example, in the following code, a Query sorts objects in the employees array in the descending order by the fullName field and filters out objects without a position containing 'CO'.

JavaScript
var books = [
    { id: '1', parentId: '1', fullName: "Samantha Bright",  position: "COO" },
    // ...
];

$(function(){
    $("#treeListContainer").dxTreeList({
        dataSource: DevExpress.data.query(employees)
                        .filter("position", "contains", "CO")
                        .sortBy("fullName", true)
                        .toArray()
    });
});
See Also