Parse not working

Hi, I have the following code (Im using webix-sidebar as well):

var jobList = {
    id: 'jobList',
    view: "datatable",
    columns: [
        {
            id: "title",
            fillspace: true
        },
        {
            id: "created",
            fillspace: true
        }
    ],
};

var sidebar = {
    id: 'sidebar',
    view: "sidebar",
    // setting the data source
    data: [
        {
            icon: "table", value: "Jobs", data: [
            {value: "All jobs", id: 'jobs'},
            {value: "Post job"}
        ]
        }
    ]
};

var header = {
    view: "template",
    template: '<img src=""/>',
    type: "header",
    height: 'auto'
};

var multiview = {
    cells: [
        {template: "Specific views here :D"},
        jobList,
    ]
};

var body = {
    cols: [
        sidebar,
        multiview
    ]
};


var layout = {
    rows: [
        header,
        body
    ]
};


webix.ready(function () {

        webix.ui(layout);

        $$('jobList').show();

        var d = [{"title":"Home #4904", "created": "date created"}, {"title":"Home #4905", "created": "date created2"}];
        $$('jobList').parse(d);
 });

The issue is that parse() doesnt update the rows while the ‘jobList’ datatable component is being displayed. Also I see no error in console. I have no clue about this issue.

If instead of webix.ui(layout) I use webix.ui(jobList), then parse() works.

I appreciate your help

Hi,

Everything is ok with parsing in your code, the problem is that you cannot see the data due to sizing problems.

The cols in the lower row (those with sidebar and multiview) are adjusted to the sidebar size, which is smaller than the size of an empty datatable.

You can solve the problem by:

Thank you very much for the quick reply! Also, one more question…

Why if I put $$('jobList').hide(); after $$('jobList').parse(d);, the datatable does not hide?

The thing is that datatable is inside the multiview. As far as I can see, you want to switch to another cell, am I right? In this case you need to call show() for the needed cell:

var multiview = { cells: [
      { template: "Specific views here :D", id:"specificViews"},
       jobList,
]};
...
$$("specificViews").show();

Btw, you can parse the data even to a hidden datatable. So you don’t need to show it before parsing and then hide: http://webix.com/snippet/50f76eaf

Alright…thank you very much