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 ={
        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
    Petyo avatar
    2444 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.

    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top