File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 50
50
limit : 8
51
51
}
52
52
} ) ;
53
- var selected = [ ] ;
54
53
developers . save = function ( ) {
55
54
store . save ( localDevelopers ) ;
56
55
return this ;
57
56
}
57
+
58
+ var selected = [ ] ;
59
+ // update status when selection changes
60
+ $ . observable ( selected ) . bind ( "insert remove" , function ( ) {
61
+ $ ( ".selected-status" ) . text ( selected . length ) ;
62
+ } ) ;
63
+
58
64
// TODO $.observable should support this binding, along with a less intrusive event facility
59
65
function bindChange ( index , developer ) {
60
66
$ . observable ( developer ) . bind ( "change" , function ( event , ui ) {
151
157
var developer = $ ( this ) . closest ( "tr" ) . data ( "grid-item" ) ;
152
158
$ . each ( selected , function ( index , developer ) {
153
159
$ . observable ( localDevelopers ) . remove ( developer ) ;
160
+ $ . observable ( selected ) . remove ( developer ) ;
154
161
} ) ;
155
162
developers . refresh ( ) ;
156
163
} ) ;
@@ -199,6 +206,11 @@ <h2>local data source</h2>
199
206
</ thead >
200
207
< tbody >
201
208
</ tbody >
209
+ < tfoot >
210
+ < tr >
211
+ < td colspan ="5 "> < span class ="selected-status "> 0</ span > row(s) selected</ td >
212
+ </ tr >
213
+ </ tfoot >
202
214
</ table >
203
215
204
216
< div >
You can’t perform that action at this time.
0 commit comments