change event not raised when defined in the model definition

2 posts, 0 answers
  1. fbaptiste
    fbaptiste avatar
    19 posts
    Member since:
    Apr 2007

    Posted 04 Dec 2014 Link to this post

    on version 2014.2.1008, I have the following simplified model definition:

    var MyModel = kendo.data.Model.define({
        id: "MyModelID",
     
        // events
        change: function (e) {
            // do smth here
        },
     
        set: function (field, value) {
            // do smth here
        }
    }

    while the set event is being triggered as expected, the change event does not.
    however, it does trigger when i define it outside of the definition scope as follows:

    myModel = new MyModel(obj);
    myModel.bind("change", function (e) {
        //do smth here
    });

    I'm trying to keep the logic of models grouped together, and that's why i'd rather use the first implementation. any solutions for this?
  2. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 08 Dec 2014 Link to this post

    Hello Fred,

    the model definition does not accept change event handlers in its definition. This seems a bit inconsistent with the widget behavior - I will log it for further consideration from our development team.

    Regards,
    Petyo
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
Back to Top