Reusing HTML

3 posts, 0 answers
  1. Lance
    Lance avatar
    25 posts
    Member since:
    Apr 2013

    Posted 16 Jun 2014 Link to this post

    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. Petyo
    Admin
    Petyo avatar
    2438 posts

    Posted 17 Jun 2014 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Lance
    Lance avatar
    25 posts
    Member since:
    Apr 2013

    Posted 10 Jul 2014 in reply to Petyo Link to this post

    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.
Back to Top