1
1
$ . widget ( "spf.pager" , {
2
2
options : {
3
- source : null ,
4
- pageSize : 2
3
+ source : null
5
4
} ,
6
5
_create : function ( ) {
7
6
var that = this ;
@@ -10,7 +9,7 @@ $.widget( "spf.pager", {
10
9
$ ( this . options . source ) . bind ( "datasourceresponse" , function ( ) {
11
10
that . refresh ( ) ;
12
11
} ) ;
13
-
12
+
14
13
this . buttons = this . element . delegate ( "button" , "click" , function ( ) {
15
14
var method = $ ( this ) . data ( "page" ) ;
16
15
that [ method ] ( ) ;
@@ -22,9 +21,9 @@ $.widget( "spf.pager", {
22
21
that . options . source . refresh ( ) ;
23
22
} ) ;
24
23
} ,
25
- refresh : function ( ) {
24
+ refresh : function ( ) {
26
25
this . buttons . button ( "enable" ) ;
27
-
26
+
28
27
var source = this . options . source ;
29
28
if ( ! source . options . paging . offset ) {
30
29
this . buttons . slice ( 0 , 3 ) . button ( "disable" )
@@ -36,36 +35,36 @@ $.widget( "spf.pager", {
36
35
this . element . find ( ".total" ) . text ( this . totalPages ( ) ) ;
37
36
this . element . find ( ".totalRecords" ) . text ( source . totalCount ) ;
38
37
} ,
39
-
38
+
40
39
totalPages : function ( ) {
41
40
return this . options . source . totalPages ( ) ;
42
41
} ,
43
-
42
+
44
43
page : function ( pageIndex ) {
45
44
return this . options . source . page ( pageIndex ) ;
46
45
} ,
47
-
46
+
48
47
first : function ( ) {
49
48
this . page ( 1 ) ;
50
49
} ,
51
-
50
+
52
51
prevStep : function ( ) {
53
52
this . options . source . options . paging . offset -= 1 ;
54
53
} ,
55
-
54
+
56
55
prev : function ( ) {
57
56
this . page ( this . page ( ) - 1 )
58
57
} ,
59
-
58
+
60
59
next : function ( ) {
61
60
this . page ( this . page ( ) + 1 )
62
61
} ,
63
-
62
+
64
63
nextStep : function ( ) {
65
64
this . options . source . options . paging . offset += 1 ;
66
65
} ,
67
-
66
+
68
67
last : function ( ) {
69
68
this . page ( this . totalPages ( ) ) ;
70
69
}
71
- } ) ;
70
+ } ) ;
0 commit comments