Helix Installation   Getting Started   Reference Documentation   Global Functions   Quick Start
ModulesClassesFunctions
 

Function Reference

ajax ( function , response_node , submit_form [true] , post_data , default_action [false] )

Description
/*
* Generate code for AJAX call.
*
* This function will generate Javascript code that makes an AJAX call to the current
* URL and passes a function to be called in the codebehind file.
*
* @param string $function The name of the function to call in the codebehind file
*/
 
Parameters
requiredfunction
optionalresponse_node
optionalsubmit_form [true]
optionalpost_data
optionaldefault_action [false]
 
Code
179  function ajax($function, $response_node=null, $submit_form=true, $post_data=null, $default_action=false)
180  {
181      $return_string = $default_action==="none" ? "" : ($default_action ? "return true;" : "return false;");
182 
183      $urlpath = parse_url($_SERVER['REQUEST_URI'],PHP_URL_PATH);
184      $params = "response_tag={$response_node}&{$post_data}";
185      $form_data = $submit_form ? "'&' + (Ext.get(this).up('form') ? (new Ext.form.BasicForm(Ext.get(this).up('form'))).getValues(true) : '')" : "''";
186      if ($submit_form)
187      {
188     
189      }
190      $s = "
191          Ext.fly('{$response_node}').load({
192              url:'{$urlpath}?ajax&noresponsetag&f={$function}',
193              params:'{$params}' + {$form_data},
194              scripts:true
195          }); {$return_string}
196      ";
197      return $s;
198  }
Get Helix PHP Framework at SourceForge.net. Fast, secure and Free Open Source software downloads