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

kendo.notify()

5 Answers 221 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rick
Top achievements
Rank 1
Rick asked on 24 Feb 2014, 03:03 PM
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);
    }
}

5 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 24 Feb 2014, 04:41 PM
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!
0
Joshua
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 25 Jul 2018, 08:40 PM

What does it do?

 

Is it still required for MVVM?

0
Plamen
Telerik team
answered on 27 Jul 2018, 07:04 AM
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
0
Joshua
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 08 Aug 2018, 09:09 PM

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.

0
Joana
Telerik team
answered on 10 Aug 2018, 01:37 PM
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
Tags
General Discussions
Asked by
Rick
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Joshua
Top achievements
Rank 2
Iron
Veteran
Iron
Plamen
Telerik team
Joana
Telerik team
Share this question
or