01.
buildForm(form) {
02.
const tableLayout =
new
kendo.Layout(
'<table class="table table-bordered" id="tbl"></table>'
,{wrap:
false
});
03.
04.
for
(
var
i=0;i<form.rows.length;i++) {
05.
const trLayout =
new
kendo.Layout(
'<tr id="tbl_row_'
+i+
'"></tr>'
,{wrap:
false
});
06.
for
(
var
j=0;j<form.rows[i].cols.length;j++) {
07.
const tdLayout =
new
kendo.Layout(
'<td><a href="#" data-bind="click: alertme">'
+form.rows[i].cols[j].label+
'</a></td>'
,
08.
{
09.
wrap:
false
,
10.
evalTemplate:
true
,
11.
model: {
12.
alertme:
function
() {
13.
console.log(
'alert!'
);
14.
}
15.
}
16.
});
17.
trLayout.append(
'#tbl_row_'
+i+, tdLayout);
18.
}
19.
tableLayout.append(
'#tbl'
,trLayout);
20.
}
21.
return
tableLayout;
22.
}
01.
const form = {
02.
rows: [{
03.
cols: [{
04.
label:
'Row 1 Col 1'
05.
}, {
06.
label:
'Row 1 Col 2'
07.
}]
08.
},{
09.
cols: [{
10.
label:
'Row 2 Col 1'
11.
}, {
12.
label:
'Row 2 Col 2'
13.
}]
14.
}]
15.
};
Hi,
I'm trying to append child layouts to a parent layout.
Is it feasible?
I'm using ES6, npm and bower to install kendo ui professional.
Thanks