How to bind Dialog button actions?

2 posts, 0 answers
  1. Christopher
    Christopher avatar
    39 posts
    Member since:
    Jan 2017

    Posted 12 Jul Link to this post

    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>

     

  2. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    558 posts

    Posted 14 Jul Link to this post

    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.
Back to Top