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

Reusing HTML

2 Answers 129 Views
SPA
This is a migrated thread and some comments may be shown as answers.
Lance
Top achievements
Rank 1
Lance asked on 16 Jun 2014, 05:31 AM
Hi,

I am writing a Kendo SPA application that uses MVVM.  I have a bit of HTML and functionality (for choosing a user) that I will be reusing throughout my application.  The functionality is as follows:
There will be a label containing a user name next to a button.  The user can click on the button and a popup window appears containing a textbox and a button.  The user puts a search term in the textbox and clicks the button.  The user is presented with a list of relevant users under the button and textbox.  Once they click on a user in the list, the window closes and the label in the main page contains the new user name.

I am able to package up the functionality in a requirejs module but not sure how to include the html and use it all in the Kendo window as described above.

Can you please point me in the right direction and let me know the recommended approach?

Thanks,

2 Answers, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 17 Jun 2014, 03:32 PM
Hi Lance,

If I understand you correctly, you may keep the form in question in a separate html file and use the window load content from ajax feature.

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Lance
Top achievements
Rank 1
answered on 10 Jul 2014, 10:06 PM
Hi Petyo,
Thanks for you answer.  This approach would work but I ended up loading a template into my requirejs module and then loading the template into the kendo window using the html method ( window.html(kendo.template(myTemplate)(viewModel)); ).  This worked well and allowed reuse.
Tags
SPA
Asked by
Lance
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Lance
Top achievements
Rank 1
Share this question
or