ultimix

- Main Page
- Data Structures
- Files
- Examples

- File List
- Globals

paging.js
Go to the documentation of this file.
1
6 if( !ultimix )
7 {
8 ultimix = {};
9 }
10
11 ultimix.SetWaitingMessage = function( Selector )
12 {
13 jQuery( Selector ).html( '<div class="grid_waiting_message">' + ultimix.lang( 'grid_waiting_message' ) + '</div>' );
14 }
15
27 ultimix.ReloadGrid = function( Selector , Ajaxed , Url )
28 {
29 if( Ajaxed )
30 {
31 Data = ultimix.ExtractFormData( Selector + ' [name=order] , ' + Selector +
32 ' [name=reorder_field] , ' + Selector + ' [name=page]' );
33 Options = { 'async' : false , 'replace' : true };
34
35 ultimix.SetWaitingMessage( Selector );
36
37 ultimix.DirectViewComposer( Selector , Data , Url , Options );
38 }
39 else
40 {
41 /* redo using data_form */
42 jQuery( Selector ).submit();
43 }
44
45 return( false );
46 }
47
61 ultimix.Reorder = function( Selector , Ajaxed , Url , FieldName )
62 {
63 if( jQuery( Selector + ' [name=order]' ).val() == 'ascending' )
64 {
65 jQuery( Selector + ' [name=order]' ).val( 'descending' );
66 }
67 else
68 {
69 jQuery( Selector + ' [name=order]' ).val( 'ascending' );
70 }
71
72 jQuery( Selector + ' [name=reorder_field]' ).val( FieldName );
73
74 ultimix.ReloadGrid( Selector , Ajaxed , Url );
75 }
76
88 ultimix.GetGrid = function( Page , FormId , FieldName )
89 {
90 Data = {};
91
92 if( jQuery( '#' + FormId ).find( '#order' ).val() == 'ascending' )
93 {
94 Data.order = 'ascending';
95 }
96 else
97 {
98 Data.order = 'descending';
99 }
100
101 Data.reorder_field = FieldName;
102 Data.page = Page;
103 Data.paging_require_form = 0;
104
105 ultimix.DirectViewComposer( '#' + FormId , Data , Page , { 'async' : false } );
106 }
107
123 ultimix.ReSetRecordsPerPage = function( Prefix , Page , FormId , FieldName , Ajaxed )
124 {
125 RecordsPerPage = jQuery( '#' + FormId ).find( '#' + Prefix + "_records_per_page" ).val();
126 jQuery.cookie( Prefix + '_records_per_page' , RecordsPerPage );
127
128 if( Ajaxed )
129 {
130 ultimix.GetGrid( Page , FormId , FieldName );
131 }
132 else
133 {
134 if( Page )
135 {
136 ultimix.data_form.submit_data( {} , false , Page );
137 }
138 else
139 {
140 ultimix.data_form.submit_data( {} , false , location.href );
141 }
142 }
143 }