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

How to bind Dialog button actions?

1 Answer 286 Views
Window
This is a migrated thread and some comments may be shown as answers.
Christopher
Top achievements
Rank 2
Iron
Christopher asked on 12 Jul 2017, 11:42 PM

I can't seem to figure out how to have the dialog actions bound to a function on the model.

I tried the following but it doesn't seem to work. What am I missing?

model = kendo.observable({
                        value: [],
                        save: function () { console.log('wheee'); }
                    });
 
kendo.bind(el, model);
 
<div data-animation="false" data-visible="true" data-role="dialog" data-resizable="false" data-title="Select Multiple" data-actions="[{ text: \'Cancel\' }, { text: \'Apply\', action: save, primary: true }]"></div>

 

1 Answer, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 14 Jul 2017, 02:04 PM
Hello Christopher,

To achieve the desired, you could attach the action function in the ViewModel using the jQuery.proxy() method. This would be needed, as the data-binding is not offered for the custom actions of the Dialog.

Here you could find a small sample implementing the above.

Regards,
Veselin Tsvetanov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Window
Asked by
Christopher
Top achievements
Rank 2
Iron
Answers by
Veselin Tsvetanov
Telerik team
Share this question
or