Extend base widget "kendo.ui.Widget"

4 posts, 0 answers
  1. Marco
    Marco avatar
    37 posts
    Member since:
    Jan 2014

    Posted 07 Apr 2015 Link to this post

    Hello,

    Is it possible to extend the base widget "kendo.ui.Widget" ?

    I tried the following, but it doesn't work:

     

    var ExtendedWidget = kendo.ui.Widget.extend({
                   init: function (element, options) {
                       kendo.ui.Widget.fn.init.call(this, element, options);
     
                       if (options.componentContainer != null)
                       {
                           options.componentContainer.push(this);
                       }
                   },
                   options: {
                       name: "Widget",
                       componentContainer: undefined
                   },
               });
       kendo.ui.plugin(ExtendedWidget);

    Kind Regards,

     

    Marco 

     

  2. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 08 Apr 2015 Link to this post

    Hello Marco,

    I think the step-by-step instructions from this documentation topic will provide the information you need for building custom Kendo UI widgets. You may also refer to this blog post for a real-life example.

    Best regards,
    Sebastian
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Marco
    Marco avatar
    37 posts
    Member since:
    Jan 2014

    Posted 08 Apr 2015 in reply to Sebastian Link to this post

    Hello Sebastian,

     Thanks for your reply. I know how to create a custom widget. But i want to add some functionality to the kendo.ui.Widget, so that all the widgets get the same (added) functionality.

    Kind Regards,

     

    Marco

  4. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 09 Apr 2015 Link to this post

    Hello again Marco,

    You can only extend the basic kendo.ui.Widget class and not add directly new functionality to its core. Hence your option would be to extend/inherit from this class and then use instances of the inherited class for additional data/functionality along with Kendo UI Widgets, if applicable.

    You may also see this help topic about inheritance for further reference.

    Regards,
    Sebastian
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top