ultimix
auto_view.js
Go to the documentation of this file.
1 
6 if( !ultimix )
7 {
8  ultimix = {};
9 }
10 
16 if( !ultimix.auto )
17 {
18  ultimix.auto = {};
19 }
20 
30 ultimix.auto.set_default_options = function( ViewOptions )
31 {
32  if( !ViewOptions )
33  {
34  ViewOptions = {};
35  }
36 
37  return( ViewOptions );
38 }
39 
49 ultimix.auto.get_list_form = function( Fuctions , ViewOptions )
50 {
51  if( !Fuctions )
52  {
53  Fuctions = {};
54  }
55 
56  ViewOptions = ultimix.auto.set_default_options( ViewOptions );
57 
58  ultimix.ajax_gate.direct_view( ViewOptions , Fuctions );
59 }
60 
78 ultimix.auto.get_custom_list_form = function( Fuctions , Header , Item , Footer , NoDataFound , ViewOptions , Prefix )
79 {
80  if( !Fuctions )
81  {
82  Fuctions = {};
83  }
84 
85  //TODO: replace *.get_list_form methods everywhere
86  //TODO: remove *.set_default_options methods everywhere
87 
88  ViewOptions = ultimix.auto.set_default_options( ViewOptions );
89 
90  ViewOptions.header = Header ? Header : Prefix + '_header.tpl';
91  ViewOptions.item = Item ? Item : Prefix + '_item.tpl';
92  ViewOptions.footer = Footer ? Footer : Prefix + '_footer.tpl';
93  ViewOptions.NoDataFound = NoDataFound ? NoDataFound : Prefix + '_no_data_found.tpl';
94 
95  ultimix.ajax_gate.direct_view( ViewOptions , Fuctions );
96 }
97 
109 ultimix.auto.delete = function( Id , DataSelector , Settings )
110 {
111  ultimix.std_dialogs.QuestionMessageBox( 'are_you_shure' ,
112  function( Result )
113  {
114  if( Result == ultimix.std_dialogs.MB_YES )
115  {
116  var ProgressDialogId = ultimix.std_dialogs.SimpleWaitingMessageBox();
117 
118  ultimix.ajax_gate.direct_controller(
119  Settings ,
120  { 'success' : ultimix.ajax_gate.succes_delete_function( DataSelector , ProgressDialogId ) } , {}
121  );
122  }
123  }
124  )
125 }
126 
140 ultimix.auto.record_view_form = function( Id , DataSelector , Settings )
141 {
142  ultimix.ajax_gate.direct_view(
143  Settings ,
144  {
145  'success' : function( Result )
146  {
147  jQuery( DataSelector ).html( Result );
148  }
149  } , {}
150  );
151 }