phpMv  -UI toolkit 2.2.5
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
JsUtilsAjaxTrait Class Reference
+ Inheritance diagram for JsUtilsAjaxTrait:

Public Member Functions

 getUrl ($url)
 
 _add_event ($element, $js, $event, $preventDefault=false, $stopPropagation=false, $immediatly=true)
 
 interval ($jsCode, $time, $globalName=null, $immediatly=true)
 
 setAjaxLoader ($loader)
 
 get ($url, $responseElement="", $parameters=[])
 Performs an ajax GET request. More...
 
 ajax ($method, $url, $responseElement="", $parameters=[])
 Performs an ajax request. More...
 
 ajaxInterval ($method, $url, $interval, $globalName=null, $responseElement="", $parameters=[])
 
 ajaxDeferred ($method, $url, $responseElement="", $parameters=[])
 Performs a deferred ajax request. More...
 
 json ($url, $method="get", $parameters=[])
 Performs an ajax request and receives the JSON data types by assigning DOM elements with the same name. More...
 
 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. More...
 
 jsonDeferred ($url, $method="get", $parameters=[])
 Prepares an ajax request delayed and receives the JSON data types by assigning DOM elements with the same name. More...
 
 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. More...
 
 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. More...
 
 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. More...
 
 getDeferred ($url, $responseElement="", $parameters=[])
 Prepares a Get ajax request for using on an event. More...
 
 getOn ($event, $element, $url, $responseElement="", $parameters=array())
 Performs a get to $url on the event $event on $element and display it in $responseElement. More...
 
 ajaxOn ($event, $element, $url, $responseElement="", $parameters=array())
 Performs an ajax request to $url on the event $event on $element and display it in $responseElement. More...
 
 ajaxOnClick ($element, $url, $responseElement="", $parameters=array())
 Performs a get to $url on the click event on $element and display it in $responseElement. More...
 
 getOnClick ($element, $url, $responseElement="", $parameters=array())
 Performs a get to $url on the click event on $element and display it in $responseElement. More...
 
 getHref ($element, $responseElement="", $parameters=array())
 Uses an hyperlink to make an ajax get request. More...
 
 postHref ($element, $responseElement="", $parameters=array())
 Uses an hyperlink to make an ajax get request. More...
 
 post ($url, $params="{}", $responseElement="", $parameters=[])
 Makes an ajax post. More...
 
 postDeferred ($url, $params="{}", $responseElement="", $parameters=[])
 Prepares a delayed ajax POST to use on an event. More...
 
 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. More...
 
 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. More...
 
 postForm ($url, $form, $responseElement, $parameters=[])
 Performs a post form with ajax. More...
 
 postFormDeferred ($url, $form, $responseElement, $parameters=[])
 Performs a delayed post form with ajax For use on an event. More...
 
 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. More...
 
 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. More...
 

Static Public Member Functions

static _correctParams ($params)
 
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, $hasLoader=false, $history=null)
 
 _getResponseElement ($responseElement)
 
 _correctAjaxUrl ($url)
 
 addLoading (&$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. More...
 
 _json ($url, $method="get", $parameters=[])
 Performs an ajax request and receives the JSON data types by assigning DOM elements with the same name. More...
 
 _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. More...
 
 _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 
)
abstract

◆ _addJsCondition()

_addJsCondition (   $jsCondition,
  $jsSource 
)
protected

Definition at line 72 of file JsUtilsAjaxTrait.php.

◆ _ajax()

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

Definition at line 23 of file JsUtilsAjaxTrait.php.

◆ _correctAjaxUrl()

_correctAjaxUrl (   $url)
protected

Definition at line 143 of file JsUtilsAjaxTrait.php.

◆ _correctParams()

static _correctParams (   $params)
static

Definition at line 152 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 206 of file JsUtilsAjaxTrait.php.

◆ _getAjaxUrl()

_getAjaxUrl (   $url,
  $attr 
)
protected

Definition at line 80 of file JsUtilsAjaxTrait.php.

◆ _getOnAjaxDone()

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

Definition at line 110 of file JsUtilsAjaxTrait.php.

◆ _getResponseElement()

_getResponseElement (   $responseElement)
protected

Definition at line 136 of file JsUtilsAjaxTrait.php.

◆ _implodeParams()

static _implodeParams (   $parameters)
static

Definition at line 162 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)

Definition at line 264 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")

Definition at line 317 of file JsUtilsAjaxTrait.php.

◆ _post()

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

Definition at line 477 of file JsUtilsAjaxTrait.php.

◆ _postForm()

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

Definition at line 534 of file JsUtilsAjaxTrait.php.

◆ addLoading()

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

Definition at line 171 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)

Definition at line 228 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)

Definition at line 253 of file JsUtilsAjaxTrait.php.

◆ ajaxInterval()

ajaxInterval (   $method,
  $url,
  $interval,
  $globalName = null,
  $responseElement = "",
  $parameters = [] 
)
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)
Returns
string

Definition at line 242 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)

Definition at line 412 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)

Definition at line 425 of file JsUtilsAjaxTrait.php.

◆ autoActiveLinks()

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

Definition at line 104 of file JsUtilsAjaxTrait.php.

◆ createAjaxParameters()

createAjaxParameters ( $original,
  $parameters 
)
protected

Definition at line 58 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)

Definition at line 216 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)

Definition at line 384 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)
Returns
$this

Definition at line 448 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)

Definition at line 398 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)

Definition at line 437 of file JsUtilsAjaxTrait.php.

◆ getUrl()

getUrl (   $url)
abstract

◆ implodeAjaxParameters()

implodeAjaxParameters (   $ajaxParameters)
protected

Definition at line 67 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)

Definition at line 282 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")

Definition at line 348 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")

Definition at line 359 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)

Definition at line 372 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)

Definition at line 305 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)

Definition at line 294 of file JsUtilsAjaxTrait.php.

◆ onPopstate()

onPopstate ( )
protected

Definition at line 100 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)

Definition at line 489 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)

Definition at line 501 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)

Definition at line 582 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)

Definition at line 595 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)

Definition at line 610 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)

Definition at line 624 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"=>false)
Returns
$this

Definition at line 466 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)

Definition at line 516 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)

Definition at line 530 of file JsUtilsAjaxTrait.php.

◆ setAjaxDataCall()

setAjaxDataCall (   $params)
protected

Definition at line 180 of file JsUtilsAjaxTrait.php.

◆ setAjaxLoader()

setAjaxLoader (   $loader)

Definition at line 197 of file JsUtilsAjaxTrait.php.

◆ setDefaultParameters()

setDefaultParameters ( $parameters,
  $default 
)
protected

Definition at line 190 of file JsUtilsAjaxTrait.php.

Field Documentation

◆ $ajaxLoader

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

Definition at line 17 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: