Search code examples
jsviews

Can't get event fired (arrayChange)


Can't get Sortable+arrayChange to work at all,

An exact example for Sortable+arrayChangethere:

[https://jsfiddle.net/ethar1/a2k0vbqj/]

Could you please help me to find out why?

BorisMoore, Thanks for your great efforts..


Solution

  • You need to listen to arrayChanges on the array, model.items not on the model.

    $([model.items]).on("arrayChange", changeHandler); 
    

    See:

    https://jsfiddle.net/r3vce9yz/

    https://www.jsviews.com/#onarrchange@jquery-on