ultimix

- Main Page
- Data Structures
- Files
- Examples

- File List
- Globals

ajax_gate.js
Go to the documentation of this file.
1
6 if( !ultimix )
7 {
8 ultimix = {};
9 }
10
16 if( !ultimix.ajax_gate )
17 {
18 ultimix.ajax_gate = {};
19 }
20
30 ultimix.ajax_gate.validate_direct_data = function( Data )
31 {
32 if( !Data.package_name )
33 {
34 ultimix.std_dialogs.ErrorMessageBox( ultimix.get_string( 'the_setting_package_name_was_not_found' ) );
35 return( false );
36 }
37
38 return( true );
39 }
40
52 ultimix.ajax_gate.direct_controller = function( Data , Functions , Options )
53 {
54 if( ultimix.ajax_gate.validate_direct_data( Data ) == false )
55 {
56 return;
57 }
58 if( !Options )
59 {
60 Options = {};
61 }
62 jQuery.extend( Options , { 'async' : true , 'dataType' : 'text' } );
63 jQuery.extend( Data , { 'auto_redirect' : 0 , 'template' : 'ajax_result_template' } );
64 if( Functions && Functions.before_request )
65 {
66 Functions.before_request();
67 }
68 var Request = {
69 async : Options.async , type : 'POST' , url : 'direct_controller.html?' + ( new Date() ).getTime() ,
70 data : Data , success : Functions ? Functions.success : false ,
71 error : Functions ? Functions.error : false , dataType : Options.data_type
72 };
73 jQuery.ajax( Request );
74 }
75
87 ultimix.ajax_gate.direct_view = function( Data , Functions , Options )
88 {
89 if( ultimix.ajax_gate.validate_direct_data( Data ) == false )
90 {
91 return;
92 }
93 Options = !Options ? {} : Options;
94 jQuery.extend( { 'async' : true , 'data_type' : 'html' } , Options );
95 jQuery.extend( { 'auto_redirect' : 0 , 'template' : 'ajax_result_template' } , Data );
96 if( Functions && Functions.before_request )
97 {
98 Functions.before_request();
99 }
100 var Request = {
101 async : Options.async , type : 'POST' , url : 'direct_view.html?' + ( new Date() ).getTime() ,
102 data : Data , success : Functions ? Functions.success : false ,
103 error : Functions ? Functions.error : false , dataType : Options.data_type
104 };
105 jQuery.ajax( Request );
106 }
107
117 ultimix.ajax_gate.succes_delete_function = function( DataSelector , ProgressDialogId )
118 {
119 return(
120 function()
121 {
122 ultimix.std_dialogs.close_message_box( ProgressDialogId );
123 ultimix.std_dialogs.InfoMessageBox( 'all_selected_records_were_deleted' );
124 jQuery( DataSelector ).remove();
125 }
126 );
127 }