Widgets vs Templates

2 posts, 0 answers
  1. Jonas Eriksson
    Jonas Eriksson avatar
    33 posts
    Member since:
    Sep 2009

    Posted 05 Mar 2013 Link to this post

    I'd like a discussion about when to use widgets and when to use templates.

    I use custom widgets quite a lot in my current (first) KendoUI Web project. And I think it's going well. The widgets do require a bit of boilerplate code, but I think they are straight forward to use and it is nice to have everything, html, bindings and behaviour nicely packaged.

    Now I need a detailstemplate in a grid and my first thought was I like to use a widget there aswell. Then I was a bit hesitatious, am I overdoing things? Should I be using templates instead of widgets?

  2. Alexander Valchev
    Alexander Valchev avatar
    2873 posts

    Posted 07 Mar 2013 Link to this post

    Hi Jonas,

    The answer of this question depends on the requirements of your project. Generally speaking, the widgets incorporate templates as well as several other features such as selection, editing, paging and etc. If you need those extra features, probably it would be better to use a widget.
    Templates on the other hand are simpler, easily configurable and in some cases easier for initialization. My suggestion is to test both approaches and decide which one fits better in your specific case.

    Kind regards,
    Alexander Valchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top