38
38
}
39
39
} ) . menugrid ( ) ;
40
40
41
+ $ ( "#pagesize" ) . change ( function ( ) {
42
+ movies . option ( "paging.limit" , + $ ( this ) . val ( ) ) . refresh ( ) ;
43
+ } ) ;
44
+
41
45
$ ( "#pager" ) . pager ( {
42
46
source : movies
43
47
} ) ;
52
56
tfoot td {
53
57
text-align : center;
54
58
}
59
+ # movies {
60
+ width : 800px ;
61
+ }
55
62
</ style >
56
63
</ head >
57
64
< body >
@@ -71,16 +78,16 @@ <h2>Movies! Click header for sort menu, use inputs for filtering, pager for pagi
71
78
< table id ="movies ">
72
79
< thead >
73
80
< tr >
74
- < th data-property ="Name " data-type ="string "> Name</ th >
75
- < th data-property ="ReleaseYear " data-type ="number "> Release Year</ th >
76
- < th data-property ="AverageRating " data-type ="number "> Average Rating</ th >
81
+ < th width =" 600 " data-property ="Name " data-type ="string "> Name</ th >
82
+ < th width =" 100 " data-property ="ReleaseYear " data-type ="number "> Release Year</ th >
83
+ < th width =" 100 " data-property ="AverageRating " data-type ="number "> Average Rating</ th >
77
84
</ tr >
78
85
</ thead >
79
86
< tbody >
80
87
</ tbody >
81
88
< tfoot >
82
89
< tr >
83
- < td id ="pager " colspan =" 2 " class ="ui-state-default ">
90
+ < td id ="pager " class ="ui-state-default ">
84
91
< button data-page ="first "> First</ button >
85
92
< button data-page ="prev "> Prev</ button >
86
93
< span >
@@ -89,7 +96,17 @@ <h2>Movies! Click header for sort menu, use inputs for filtering, pager for pagi
89
96
< button data-page ="next "> Next</ button >
90
97
< button data-page ="last "> Last</ button >
91
98
</ td >
92
- < td class ="ui-state-default "> Viewing rows < span class ="paging-from "> 0</ span > to < span class ="paging-to "> 0</ span > of < span class ="paging-total "> 0</ span >
99
+ < td class ="ui-state-default ">
100
+ < label for ="pagesize "> Pagesize</ label >
101
+ < select id ="pagesize ">
102
+ < option > 10</ option >
103
+ < option > 20</ option >
104
+ < option > 30</ option >
105
+ </ select >
106
+ </ td >
107
+ < td class ="ui-state-default ">
108
+ Viewing rows < span class ="paging-from "> 0</ span > to < span class ="paging-to "> 0</ span > of < span class ="paging-total "> 0</ span >
109
+ </ td >
93
110
</ tr >
94
111
</ tfoot >
95
112
</ table >
0 commit comments