kendo.notify()

6 posts, 0 answers
  1. Rick
    Rick avatar
    15 posts
    Member since:
    Nov 2013

    Posted 24 Feb 2014 Link to this post

    We are creating custom widgets that need to look, feel, and perform on-par with Kendo widgets. We've spent a little time in source and found some undocumented methods... like kendo.notify() that appear to play an important role in data binding.

    Should or should we not be using these methods as we create our own widgets?


    [ kendo.button.js ]

    var Button = Widget.extend({
        init: function(element, options) {
            var that = this;

            Widget.fn.init.call(that, element, options);

            ...

            element
                .on(CLICK + NS, proxy(that._click, that))
                .on("focus" + NS, proxy(that._focus, that))
                .on("blur" + NS, proxy(that._blur, that))
                .on("keydown" + NS, proxy(that._keydown, that))
                .on("keyup" + NS, proxy(that._keyup, that));

            kendo.notify(that); // Implementation found in kendo.all.js on line ~11691
        },


    [ kendo.all.js ]

    kendo.notify = notify;

    ...

    function notify(widget, namespace) {
        var element = widget.element,
            bindingTarget = element[0].kendoBindingTarget;

        if (bindingTarget) {
            bind(element, bindingTarget.source, namespace);
        }
    }
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 24 Feb 2014 Link to this post

    Hello Rick,

    That method call is only needed if your widget needs to support MVVM. It is a noop if Kendo MVVM isn't included.

    Regards,
    Atanas Korchev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Joshua
    Joshua avatar
    69 posts
    Member since:
    May 2012

    Posted 25 Jul in reply to Atanas Korchev Link to this post

    What does it do?

     

    Is it still required for MVVM?

  4. Plamen
    Admin
    Plamen avatar
    2896 posts

    Posted 27 Jul Link to this post

    Hi,

    There is not change in the behavior of the method - it is used only for MVVM scenarios. You can review what exactly is is doing in our public repository here.

    Regards,
    Plamen
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  5. Joshua
    Joshua avatar
    69 posts
    Member since:
    May 2012

    Posted 08 Aug in reply to Plamen Link to this post

    I have read through that, but it is a giant framework. I still don't know what it is triggering to happen.

     

    I don't even think there is documentation on bindingTargets and how they are used.

  6. Joana
    Admin
    Joana avatar
    166 posts

    Posted 10 Aug Link to this post

    Hi Joshua,

    The bindingTarget is basically the element that is to be bound to MVVM and the notify method is used to make sure that all "data-" attributes are handled properly.

    As my colleagues have already explained, the method is used internally and is part of our MVVM functionality. Here you could find the binding logic:

    https://github.com/telerik/kendo-ui-core/blob/master/src/kendo.binder.js#L1788 

    However, if you need assistance in how you could use it in custom widgets so that it could be easily bound to MVVM our Professional services will be able to further guide you.

    Let me know if you'd like to get advantage of the Professional service.

    Regards,
    Joana
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top