dungnt
1
Hi all !
I have a layout:
var layout = webix.ui({
view:"layout",
container:"mydiv",
rows: [
{
cols: [
]
}
]
})
How do i add a component to “cols” ?
And i have a datatable:
var datatable = webix.ui({
view: "datatable",
......../*config*/......
});
I want add datatable to the layout with a section code like this: layout.add(datatable);
How do i do ?
maksim
2
You need to define id for the related layout
var layout = webix.ui({
view:"layout",
container:"mydiv",
rows: [
{ id:"subview",
cols: [
]
}
]
})
and later you can use
$$("subview").addView({
view: "datatable",
......../*config*/......
})
dungnt
3
Can you help me, @maksim ?
dungnt
4
@maksim
Can i do it without define id ?
How do i add components into cols of “subview” ?
maksim
5
You need some way to identify the target view. It can be an id or you can use getChildViews command to locate the necessary view
var sub = layout.getChildViews()[0]; //first child of top level layout
sub.addView({
view: "datatable",
......../*config*/......
})