@@ -72,7 +72,7 @@ $(function () {
72
72
el : '#thingstable' ,
73
73
template : '#thingstable-tpl' ,
74
74
events : { 'click .btn-machi' : 'add' } ,
75
- collectionEvents : { 'change' : 'setTotal' , 'remove' : 'render' } ,
75
+ collectionEvents : { 'change' : 'setTotal' , 'reset remove' : 'render' } ,
76
76
setTotal : function ( ) { this . $ ( '.total' ) . text ( this . collection . total ( ) ) ; } ,
77
77
add : function ( ) { this . collection . add ( { } ) ; } ,
78
78
onRender : function ( ) { this . setTotal ( ) ; }
@@ -86,7 +86,7 @@ $(function () {
86
86
template : '#ppltable-tpl' ,
87
87
events : { 'click .btn-machi' : 'add' } ,
88
88
collectionEvents : { 'remove change' : 'render' } ,
89
- initialize : function ( ) { this . listenTo ( App . things , 'add change remove' , this . render ) ; } ,
89
+ initialize : function ( ) { this . listenTo ( App . things , 'reset add change remove' , this . render ) ; } ,
90
90
setTotal : function ( ) { this . $ ( '.total' ) . text ( this . collection . total ( ) ) ; } ,
91
91
add : function ( ) { this . collection . add ( { } ) ; } ,
92
92
serializeData : function ( ) { return _ . extend ( { things : App . things } , this . collection . toJSON ( ) ) ; } ,
0 commit comments