This is a migrated thread and some comments may be shown as answers.

Append Layout to another layout (ES6)

3 Answers 17 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Pedro
Top achievements
Rank 1
Pedro asked on 31 Jan 2017, 11:41 AM
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

3 Answers, 1 is accepted

Sort by
0
Pedro
Top achievements
Rank 1
answered on 31 Jan 2017, 01:46 PM
I'm working for a company which wants to replace its old single page application (GWT) with modern javascript technologies.
They are impressed by kendo ui components (mostly by the pivot grid) and they do want to use them.
Unfortunately the development is blocked by the above-written issue.
Solving this issue is critical because it will be decisive on licenses buy. 
0
Pedro
Top achievements
Rank 1
answered on 31 Jan 2017, 01:55 PM
Unfortunately testing is blocked by the above-written issue.
0
Stefan
Telerik team
answered on 02 Feb 2017, 09:42 AM
Hello Pedro,

Thank you for your interest in Kendo UI.

In general, the layout it's an instance of the view, which is allowing nesting multiple layouts:

http://docs.telerik.com/kendo-ui/framework/spa/layout#functionalities

I can also suggest checking the following article for the SPA applications with Kendo UI:

https://ssnenov.wordpress.com/2013/03/24/single-page-up-with-kendo-ui/

If additional assistance is needed, please provide a fully runnable example, so I can investigate further.

Regards,
Stefan
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
General Discussions
Asked by
Pedro
Top achievements
Rank 1
Answers by
Pedro
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or