phpMv -UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
Loading...
Searching...
No Matches
JsUtilsAjaxTrait Class Reference
+ Inheritance diagram for JsUtilsAjaxTrait:

Public Member Functions

 getUrl ($url)
 
 _add_event ($element, $js, $event, $preventDefault=false, $stopPropagation=false, $immediatly=true, $listenerOn=false)
 
 interval ($jsCode, $time, $globalName=null, $immediatly=true)
 
 setAjaxLoader ($loader)
 
 get ($url, $responseElement='', $parameters=[])
 Performs an ajax GET request.
 
 ajax ($method, $url, $responseElement='', $parameters=[])
 Performs an ajax request.
 
 ajaxInterval ($method, $url, $interval, $globalName=null, $responseElement='', $parameters=[], $immediatly=true)
 Executes an ajax query at regular intervals.
 
 ajaxDeferred ($method, $url, $responseElement='', $parameters=[])
 Performs a deferred ajax request.
 
 json ($url, $method="get", $parameters=[])
 Performs an ajax request and receives the JSON data types by assigning DOM elements with the same name.
 
 jsonOn ($event, $element, $url, $method='get', $parameters=array())
 Makes an ajax request and receives the JSON data types by assigning DOM elements with the same name when $event fired on $element.
 
 jsonDeferred ($url, $method='get', $parameters=[])
 Prepares an ajax request delayed and receives the JSON data types by assigning DOM elements with the same name.
 
 jsonArray ($maskSelector, $url, $method='get', $parameters=[])
 Performs an ajax request and receives the JSON array data types by assigning DOM elements with the same name.
 
 jsonArrayDeferred ($maskSelector, $url, $method='get', $parameters=[])
 Peforms an ajax request delayed and receives a JSON array data types by copying and assigning them to the DOM elements with the same name.
 
 jsonArrayOn ($event, $element, $maskSelector, $url, $method='get', $parameters=array())
 Performs an ajax request and receives the JSON array data types by assigning DOM elements with the same name when $event fired on $element.
 
 getDeferred ($url, $responseElement="", $parameters=[])
 Prepares a Get ajax request for using on an event.
 
 getOn ($event, $element, $url, $responseElement="", $parameters=array())
 Performs a get to $url on the event $event on $element and display it in $responseElement.
 
 ajaxOn ($event, $element, $url, $responseElement='', $parameters=array())
 Performs an ajax request to $url on the event $event on $element and display it in $responseElement.
 
 ajaxOnClick ($element, $url, $responseElement='', $parameters=array())
 Performs a get to $url on the click event on $element and display it in $responseElement.
 
 getOnClick ($element, $url, $responseElement='', $parameters=array())
 Performs a get to $url on the click event on $element and display it in $responseElement.
 
 getHref ($element, $responseElement="", $parameters=array())
 Uses an hyperlink to make an ajax get request.
 
 postHref ($element, $responseElement="", $parameters=array())
 Uses an hyperlink to make an ajax get request.
 
 postFormAction ($element, $responseElement="", $parameters=array())
 Uses a form action to make an ajax post request.
 
 post ($url, $params="{}", $responseElement="", $parameters=[])
 Makes an ajax post.
 
 postDeferred ($url, $params="{}", $responseElement="", $parameters=[])
 Prepares a delayed ajax POST to use on an event.
 
 postOn ($event, $element, $url, $params="{}", $responseElement="", $parameters=array())
 Performs a post to $url on the event $event fired on $element and pass the parameters $params Display the result in $responseElement.
 
 postOnClick ($element, $url, $params='{}', $responseElement='', $parameters=array())
 Performs a post to $url on the click event fired on $element and pass the parameters $params Display the result in $responseElement.
 
 postForm ($url, $form, $responseElement, $parameters=[])
 Performs a post form with ajax.
 
 postFormDeferred ($url, $form, $responseElement, $parameters=[])
 Performs a delayed post form with ajax For use on an event.
 
 postFormOn ($event, $element, $url, $form, $responseElement="", $parameters=array())
 Performs a post form with ajax in response to an event $event on $element display the result in $responseElement.
 
 postFormOnClick ($element, $url, $form, $responseElement="", $parameters=array())
 Performs a post form with ajax in response to the click event on $element display the result in $responseElement.
 
 addCsrf ($name='csrf-token')
 

Static Public Member Functions

static _correctParams ($params, $ajaxParameters=[])
 
static _implodeParams ($parameters)
 

Protected Member Functions

 _ajax ($method, $url, $responseElement='', $parameters=[])
 
 createAjaxParameters (&$original, $parameters)
 
 implodeAjaxParameters ($ajaxParameters)
 
 _addJsCondition ($jsCondition, $jsSource)
 
 _getAjaxUrl ($url, $attr)
 
 onPopstate ()
 
 autoActiveLinks ($previousURL="window.location.href")
 
 _getOnAjaxDone ($responseElement, $jqueryDone, $ajaxTransition, $jsCallback, $history=null)
 
 removeLoader ($hasLoader)
 
 _getResponseElement ($responseElement)
 
 _getFormElement ($formElement)
 
 _correctAjaxUrl ($url)
 
 addLoading (&$retour, $responseElement, $ajaxLoader=null)
 
 addResponseLoading (&$retour, $responseElement, $ajaxLoader=null)
 
 setAjaxDataCall ($params)
 
 setDefaultParameters (&$parameters, $default)
 

Protected Attributes

 $ajaxTransition
 
 $ajaxLoader = "<div class=\"ui active centered inline text loader\">Loading</div>"
 

Private Member Functions

 _get ($url, $responseElement='', $parameters=[])
 Performs an ajax GET request.
 
 _json ($url, $method="get", $parameters=[])
 Performs an ajax request and receives the JSON data types by assigning DOM elements with the same name.
 
 _jsonArray ($maskSelector, $url, $method='get', $parameters=[])
 Performs an ajax request and receives the JSON array data types by assigning DOM elements with the same name.
 
 _post ($url, $params='{}', $responseElement='', $parameters=[])
 
 _postForm ($url, $form, $responseElement, $parameters=[])
 

Detailed Description

Definition at line 14 of file JsUtilsAjaxTrait.php.

Member Function Documentation

◆ _add_event()

_add_event (   $element,
  $js,
  $event,
  $preventDefault = false,
  $stopPropagation = false,
  $immediatly = true,
  $listenerOn = false 
)
abstract

Reimplemented in JsUtils.

◆ _addJsCondition()

_addJsCondition (   $jsCondition,
  $jsSource 
)
protected

Definition at line 119 of file JsUtilsAjaxTrait.php.

◆ _ajax()

_ajax (   $method,
  $url,
  $responseElement = '',
  $parameters = [] 
)
protected

Definition at line 26 of file JsUtilsAjaxTrait.php.

◆ _correctAjaxUrl()

_correctAjaxUrl (   $url)
protected

Definition at line 210 of file JsUtilsAjaxTrait.php.

◆ _correctParams()

static _correctParams (   $params,
  $ajaxParameters = [] 
)
static

Definition at line 219 of file JsUtilsAjaxTrait.php.

◆ _get()

_get (   $url,
  $responseElement = '',
  $parameters = [] 
)
private

Performs an ajax GET request.

Parameters
string$urlThe url of the request
string$responseElementselector of the HTML element displaying the answer

Definition at line 288 of file JsUtilsAjaxTrait.php.

◆ _getAjaxUrl()

_getAjaxUrl (   $url,
  $attr 
)
protected

Definition at line 126 of file JsUtilsAjaxTrait.php.

◆ _getFormElement()

_getFormElement (   $formElement)
protected

Definition at line 203 of file JsUtilsAjaxTrait.php.

◆ _getOnAjaxDone()

_getOnAjaxDone (   $responseElement,
  $jqueryDone,
  $ajaxTransition,
  $jsCallback,
  $history = null 
)
protected

Definition at line 159 of file JsUtilsAjaxTrait.php.

◆ _getResponseElement()

_getResponseElement (   $responseElement)
protected

Definition at line 196 of file JsUtilsAjaxTrait.php.

◆ _implodeParams()

static _implodeParams (   $parameters)
static

Definition at line 233 of file JsUtilsAjaxTrait.php.

◆ _json()

_json (   $url,
  $method = "get",
  $parameters = [] 
)
private

Performs an ajax request and receives the JSON data types by assigning DOM elements with the same name.

Parameters
string$urlthe request url
string$methodMethod used
array$parametersdefault : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","context"=>"document","jsCondition"=>NULL,"headers"=>null,"immediatly"=>false,"before"=>null)

Definition at line 373 of file JsUtilsAjaxTrait.php.

◆ _jsonArray()

_jsonArray (   $maskSelector,
  $url,
  $method = 'get',
  $parameters = [] 
)
private

Performs an ajax request and receives the JSON array data types by assigning DOM elements with the same name.

Parameters
string$maskSelector
string$urlthe request url
string$methodMethod used, default : get
array$parametersdefault : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","context"=>null,"jsCondition"=>NULL,"headers"=>null,"immediatly"=>false,"rowClass"=>"_json","before"=>null)

Definition at line 447 of file JsUtilsAjaxTrait.php.

◆ _post()

_post (   $url,
  $params = '{}',
  $responseElement = '',
  $parameters = [] 
)
private

Definition at line 705 of file JsUtilsAjaxTrait.php.

◆ _postForm()

_postForm (   $url,
  $form,
  $responseElement,
  $parameters = [] 
)
private

Definition at line 784 of file JsUtilsAjaxTrait.php.

◆ addCsrf()

addCsrf (   $name = 'csrf-token')

Definition at line 926 of file JsUtilsAjaxTrait.php.

◆ addLoading()

addLoading ( $retour,
  $responseElement,
  $ajaxLoader = null 
)
protected

Definition at line 242 of file JsUtilsAjaxTrait.php.

◆ addResponseLoading()

addResponseLoading ( $retour,
  $responseElement,
  $ajaxLoader = null 
)
protected

Definition at line 250 of file JsUtilsAjaxTrait.php.

◆ ajax()

ajax (   $method,
  $url,
  $responseElement = '',
  $parameters = [] 
)

Performs an ajax request.

Parameters
string$methodThe http method (get, post, delete, put, head)
string$urlThe url of the request
string$responseElementselector of the HTML element displaying the answer
array$parametersdefault : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)

Definition at line 319 of file JsUtilsAjaxTrait.php.

◆ ajaxDeferred()

ajaxDeferred (   $method,
  $url,
  $responseElement = '',
  $parameters = [] 
)

Performs a deferred ajax request.

Parameters
string$methodThe http method (get, post, delete, put, head)
string$urlThe url of the request
string$responseElementselector of the HTML element displaying the answer
array$parametersdefault : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)

Definition at line 358 of file JsUtilsAjaxTrait.php.

◆ ajaxInterval()

ajaxInterval (   $method,
  $url,
  $interval,
  $globalName = null,
  $responseElement = '',
  $parameters = [],
  $immediatly = true 
)

Executes an ajax query at regular intervals.

Parameters
string$methodThe http method (post, get...)
string$urlThe url of the request
int$intervalThe interval in milliseconds
string$globalNameThe interval name, for clear it
string$responseElement
array$parametersThe ajax parameters, default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)
$immediatly
Returns
string

Definition at line 342 of file JsUtilsAjaxTrait.php.

◆ ajaxOn()

ajaxOn (   $event,
  $element,
  $url,
  $responseElement = '',
  $parameters = array() 
)

Performs an ajax request to $url on the event $event on $element and display it in $responseElement.

Parameters
string$eventthe event observed
string$elementthe element on which event is observed
string$urlThe url of the request
string$responseElementThe selector of the HTML element displaying the answer
array$parametersdefault : array("method"=>"get","preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null,"listenerOn"=>false)

Definition at line 577 of file JsUtilsAjaxTrait.php.

◆ ajaxOnClick()

ajaxOnClick (   $element,
  $url,
  $responseElement = '',
  $parameters = array() 
)

Performs a get to $url on the click event on $element and display it in $responseElement.

Parameters
string$elementthe element on which event is observed
string$urlThe url of the request
string$responseElementThe selector of the HTML element displaying the answer
array$parametersdefault : array("method"=>"get","preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null,"listenerOn"=>false)

Definition at line 601 of file JsUtilsAjaxTrait.php.

◆ autoActiveLinks()

autoActiveLinks (   $previousURL = "window.location.href")
protected

Definition at line 153 of file JsUtilsAjaxTrait.php.

◆ createAjaxParameters()

createAjaxParameters ( $original,
  $parameters 
)
protected

Definition at line 89 of file JsUtilsAjaxTrait.php.

◆ get()

get (   $url,
  $responseElement = '',
  $parameters = [] 
)

Performs an ajax GET request.

Parameters
string$urlThe url of the request
string$responseElementselector of the HTML element displaying the answer
array$parametersdefault : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)

Definition at line 302 of file JsUtilsAjaxTrait.php.

◆ getDeferred()

getDeferred (   $url,
  $responseElement = "",
  $parameters = [] 
)

Prepares a Get ajax request for using on an event.

Parameters
string$urlThe url of the request
string$responseElementselector of the HTML element displaying the answer
array$parametersdefault : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)

Definition at line 537 of file JsUtilsAjaxTrait.php.

◆ getHref()

getHref (   $element,
  $responseElement = "",
  $parameters = array() 
)

Uses an hyperlink to make an ajax get request.

Parameters
string$elementan hyperlink selector
string$responseElementthe target of the ajax request (data-target attribute of the element is used if responseElement is omited)
array$parametersdefault : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"href","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","jsCondition"=>NULL,"headers"=>null,"historize"=>true,"before"=>null,"listenerOn"=>false)
Returns
$this

Definition at line 633 of file JsUtilsAjaxTrait.php.

◆ getOn()

getOn (   $event,
  $element,
  $url,
  $responseElement = "",
  $parameters = array() 
)

Performs a get to $url on the event $event on $element and display it in $responseElement.

Parameters
string$eventthe event
string$elementthe element on which event is observed
string$urlThe url of the request
string$responseElementThe selector of the HTML element displaying the answer
array$parametersdefault : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>null,"headers"=>null,"historize"=>false,"before"=>null,"listenerOn"=>false)

Definition at line 557 of file JsUtilsAjaxTrait.php.

◆ getOnClick()

getOnClick (   $element,
  $url,
  $responseElement = '',
  $parameters = array() 
)

Performs a get to $url on the click event on $element and display it in $responseElement.

Parameters
string$elementthe element on which click is observed
string$urlThe url of the request
string$responseElementThe selector of the HTML element displaying the answer
array$parametersdefault : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null,"listenerOn"=>false)

Definition at line 618 of file JsUtilsAjaxTrait.php.

◆ getUrl()

getUrl (   $url)
abstract

Reimplemented in JsUtils, _JsUtils, JsUtils, JsUtils, JsUtils, JsUtils, JsUtils, and JsUtils.

◆ implodeAjaxParameters()

implodeAjaxParameters (   $ajaxParameters)
protected

Definition at line 104 of file JsUtilsAjaxTrait.php.

◆ interval()

interval (   $jsCode,
  $time,
  $globalName = null,
  $immediatly = true 
)
abstract

◆ json()

json (   $url,
  $method = "get",
  $parameters = [] 
)

Performs an ajax request and receives the JSON data types by assigning DOM elements with the same name.

Parameters
string$urlthe request url
string$methodMethod used
array$parametersdefault : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","context"=>"document","jsCondition"=>NULL,"headers"=>null,"immediatly"=>false,"before"=>null)

Definition at line 395 of file JsUtilsAjaxTrait.php.

◆ jsonArray()

jsonArray (   $maskSelector,
  $url,
  $method = 'get',
  $parameters = [] 
)

Performs an ajax request and receives the JSON array data types by assigning DOM elements with the same name.

Parameters
string$maskSelector
string$urlthe request url
string$methodMethod used, default : get
array$parametersdefault : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","context"=>null,"jsCondition"=>NULL,"headers"=>null,"immediatly"=>false,"rowClass"=>"_json","before"=>null)

Definition at line 484 of file JsUtilsAjaxTrait.php.

◆ jsonArrayDeferred()

jsonArrayDeferred (   $maskSelector,
  $url,
  $method = 'get',
  $parameters = [] 
)

Peforms an ajax request delayed and receives a JSON array data types by copying and assigning them to the DOM elements with the same name.

Parameters
string$maskSelector
string$urlthe request url
string$methodMethod used, default : get
array$parametersdefault : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","context"=>null,"jsCondition"=>NULL,"headers"=>null,"rowClass"=>"_json","before"=>null)

Definition at line 499 of file JsUtilsAjaxTrait.php.

◆ jsonArrayOn()

jsonArrayOn (   $event,
  $element,
  $maskSelector,
  $url,
  $method = 'get',
  $parameters = array() 
)

Performs an ajax request and receives the JSON array data types by assigning DOM elements with the same name when $event fired on $element.

Parameters
string$element
string$event
string$urlthe request url
string$methodMethod used, default : get
array$parametersdefault : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","params"=>"{}","method"=>"get","rowClass"=>"_json","immediatly"=>true,"before"=>null,"listenerOn"=>false)

Definition at line 516 of file JsUtilsAjaxTrait.php.

◆ jsonDeferred()

jsonDeferred (   $url,
  $method = 'get',
  $parameters = [] 
)

Prepares an ajax request delayed and receives the JSON data types by assigning DOM elements with the same name.

Parameters
string$urlthe request url
string$methodMethod used
array$parametersdefault : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","context"=>"document","jsCondition"=>NULL,"headers"=>null,"immediatly"=>false,"before"=>null)

Definition at line 431 of file JsUtilsAjaxTrait.php.

◆ jsonOn()

jsonOn (   $event,
  $element,
  $url,
  $method = 'get',
  $parameters = array() 
)

Makes an ajax request and receives the JSON data types by assigning DOM elements with the same name when $event fired on $element.

Parameters
string$element
string$event
string$urlthe request address
string$methoddefault get
array$parametersdefault : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","params"=>"{}","method"=>"get","immediatly"=>true,"before"=>null,"listenerOn"=>false)

Definition at line 411 of file JsUtilsAjaxTrait.php.

◆ onPopstate()

onPopstate ( )
protected

Definition at line 149 of file JsUtilsAjaxTrait.php.

◆ post()

post (   $url,
  $params = "{}",
  $responseElement = "",
  $parameters = [] 
)

Makes an ajax post.

Parameters
string$urlthe request url
string$responseElementselector of the HTML element displaying the answer
string$paramsJSON parameters
array$parametersdefault : array("jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)

Definition at line 722 of file JsUtilsAjaxTrait.php.

◆ postDeferred()

postDeferred (   $url,
  $params = "{}",
  $responseElement = "",
  $parameters = [] 
)

Prepares a delayed ajax POST to use on an event.

Parameters
string$urlthe request url
string$paramsJSON parameters
string$responseElementselector of the HTML element displaying the answer
array$parametersdefault : array("jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)

Definition at line 740 of file JsUtilsAjaxTrait.php.

◆ postForm()

postForm (   $url,
  $form,
  $responseElement,
  $parameters = [] 
)

Performs a post form with ajax.

Parameters
string$urlThe url of the request
string$formThe form HTML id
string$responseElementselector of the HTML element displaying the answer
array$parametersdefault : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)

Definition at line 864 of file JsUtilsAjaxTrait.php.

◆ postFormAction()

postFormAction (   $element,
  $responseElement = "",
  $parameters = array() 
)

Uses a form action to make an ajax post request.

Parameters
string$elementa form selector
string$responseElementthe target of the ajax request (data-target attribute of the element is used if responseElement is omited)
array$parametersdefault : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"href","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","jsCondition"=>NULL,"headers"=>null,"historize"=>true,"before"=>null,"listenerOn"=>false)
Returns
$this

Definition at line 684 of file JsUtilsAjaxTrait.php.

◆ postFormDeferred()

postFormDeferred (   $url,
  $form,
  $responseElement,
  $parameters = [] 
)

Performs a delayed post form with ajax For use on an event.

Parameters
string$urlThe url of the request
string$formThe form HTML id
string$responseElementselector of the HTML element displaying the answer
array$parametersdefault : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null)

Definition at line 882 of file JsUtilsAjaxTrait.php.

◆ postFormOn()

postFormOn (   $event,
  $element,
  $url,
  $form,
  $responseElement = "",
  $parameters = array() 
)

Performs a post form with ajax in response to an event $event on $element display the result in $responseElement.

Parameters
string$event
string$element
string$url
string$form
string$responseElementselector of the HTML element displaying the answer
array$parametersdefault : array("preventDefault"=>true,"stopPropagation"=>true,"validation"=>false,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>null,"headers"=>null,"historize"=>false,"before"=>null,"listenerOn"=>false)

Definition at line 900 of file JsUtilsAjaxTrait.php.

◆ postFormOnClick()

postFormOnClick (   $element,
  $url,
  $form,
  $responseElement = "",
  $parameters = array() 
)

Performs a post form with ajax in response to the click event on $element display the result in $responseElement.

Parameters
string$element
string$url
string$form
string$responseElementselector of the HTML element displaying the answer
array$parametersdefault : array("preventDefault"=>true,"stopPropagation"=>true,"validation"=>false,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>null,"headers"=>null,"historize"=>false,"before"=>null,"listenerOn"=>false)

Definition at line 922 of file JsUtilsAjaxTrait.php.

◆ postHref()

postHref (   $element,
  $responseElement = "",
  $parameters = array() 
)

Uses an hyperlink to make an ajax get request.

Parameters
string$elementan hyperlink selector
string$responseElementthe target of the ajax request (data-target attribute of the element is used if responseElement is omited)
array$parametersdefault : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"href","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","jsCondition"=>NULL,"headers"=>null,"historize"=>true,"before"=>null,"listenerOn"=>false)
Returns
$this

Definition at line 660 of file JsUtilsAjaxTrait.php.

◆ postOn()

postOn (   $event,
  $element,
  $url,
  $params = "{}",
  $responseElement = "",
  $parameters = array() 
)

Performs a post to $url on the event $event fired on $element and pass the parameters $params Display the result in $responseElement.

Parameters
string$event
string$element
string$urlThe url of the request
string$paramsThe parameters to send
string$responseElementselector of the HTML element displaying the answer
array$parametersdefault : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null,"listenerOn"=>false)

Definition at line 760 of file JsUtilsAjaxTrait.php.

◆ postOnClick()

postOnClick (   $element,
  $url,
  $params = '{}',
  $responseElement = '',
  $parameters = array() 
)

Performs a post to $url on the click event fired on $element and pass the parameters $params Display the result in $responseElement.

Parameters
string$element
string$urlThe url of the request
string$paramsThe parameters to send
string$responseElementselector of the HTML element displaying the answer
array$parametersdefault : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false,"before"=>null,"before"=>null,"listenerOn"=>false)

Definition at line 780 of file JsUtilsAjaxTrait.php.

◆ removeLoader()

removeLoader (   $hasLoader)
protected

Definition at line 183 of file JsUtilsAjaxTrait.php.

◆ setAjaxDataCall()

setAjaxDataCall (   $params)
protected

Definition at line 259 of file JsUtilsAjaxTrait.php.

◆ setAjaxLoader()

setAjaxLoader (   $loader)

Definition at line 276 of file JsUtilsAjaxTrait.php.

◆ setDefaultParameters()

setDefaultParameters ( $parameters,
  $default 
)
protected

Definition at line 269 of file JsUtilsAjaxTrait.php.

Field Documentation

◆ $ajaxLoader

$ajaxLoader = "<div class=\"ui active centered inline text loader\">Loading</div>"
protected

Definition at line 18 of file JsUtilsAjaxTrait.php.

◆ $ajaxTransition

$ajaxTransition
protected

Definition at line 16 of file JsUtilsAjaxTrait.php.


The documentation for this class was generated from the following file: