webix with backbone

Hi,
I am having a hard time getting the sample from your documenation to work.
My code looks like this:

(function () {


    var mydata = [
        { id: '1', value: 'File1.txt', type: "text", date: 1420717913, size: 4500 },
        { id: '2', value: 'File2.txt', type: "text", date: 1420717913, size: 5500 },
        { id: '3', value: 'File3.txt', type: "text", date: 1420717913, size: 6500 }
    ]


    FileItem = Backbone.Model.extend({
        idAttribute: 'id',
        defaults: {
            value: "",
            type: "",
            size: 0
        },
        parse: function (data) {
            return data;
        }
    });

    FileList = Backbone.Collection.extend({
        model: FileItem,
        url: "../scripts/data.js",
        parse: function (data) {
            return data;
        }
    });

    files = new FileList();
    files.fetch();

    MyView = WebixView.extend({
        config: {
            view: "list",
            id: "mylist",
            width: 200,
            template: "#value#.#type#",
            select: true
        },
        afterRender: function () {
            var x = this.getChild("mylist");
            this.getChild("mylist").sync(this.options.collection);
        }
    });

    var v = new MyView({
        el: ".app1",
        collection: files
    }).render();

})();

but the line with this.getChild(“mylist”) throws an “undefined is not a function”. And the html just contains an empty listview. Can someone help, please?

Joachim

getChild returns some child of top level element, so you need to use this.root instead

http://webix.com/snippet/7781b936

or add the top level layout

http://webix.com/snippet/d68915f1

thanks, I got it working now.