|
@@ 187-198 (lines=12) @@
|
| 184 |
|
* @param string $url the request address |
| 185 |
|
* @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","params"=>"{}","method"=>"get","immediatly"=>true) |
| 186 |
|
*/ |
| 187 |
|
public function jsonOn($event,$element, $url,$parameters=array()) { |
| 188 |
|
$preventDefault=true; |
| 189 |
|
$stopPropagation=true; |
| 190 |
|
$jsCallback=null; |
| 191 |
|
$attr="id"; |
| 192 |
|
$method="get"; |
| 193 |
|
$context="document"; |
| 194 |
|
$params="{}"; |
| 195 |
|
$immediatly=true; |
| 196 |
|
extract($parameters); |
| 197 |
|
return $this->_add_event($element, $this->_json($url,$method, $params,$jsCallback, $attr,$context), $event, $preventDefault, $stopPropagation,$immediatly); |
| 198 |
|
} |
| 199 |
|
|
| 200 |
|
/** |
| 201 |
|
* Prepares an ajax request delayed and receives the JSON data types by assigning DOM elements with the same name |
|
@@ 281-293 (lines=13) @@
|
| 278 |
|
* @param string $url the request url |
| 279 |
|
* @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","params"=>"{}","method"=>"get","rowClass"=>"_json","immediatly"=>true) |
| 280 |
|
*/ |
| 281 |
|
public function jsonArrayOn($event,$element,$maskSelector, $url,$parameters=array()) { |
| 282 |
|
$preventDefault=true; |
| 283 |
|
$stopPropagation=true; |
| 284 |
|
$jsCallback=null; |
| 285 |
|
$attr="id"; |
| 286 |
|
$method="get"; |
| 287 |
|
$context = null; |
| 288 |
|
$params="{}"; |
| 289 |
|
$immediatly=true; |
| 290 |
|
$rowClass="_json"; |
| 291 |
|
extract($parameters); |
| 292 |
|
return $this->_add_event($element, $this->_jsonArray($maskSelector,$url,$method, $params,$jsCallback, $rowClass, $context,$attr), $event, $preventDefault, $stopPropagation,$immediatly); |
| 293 |
|
} |
| 294 |
|
|
| 295 |
|
/** |
| 296 |
|
* Prepares a Get ajax request |
|
@@ 389-400 (lines=12) @@
|
| 386 |
|
* @param string $responseElement selector of the HTML element displaying the answer |
| 387 |
|
* @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null) |
| 388 |
|
*/ |
| 389 |
|
public function postOn($event, $element, $url, $params="{}", $responseElement="", $parameters=array()) { |
| 390 |
|
$preventDefault=true; |
| 391 |
|
$stopPropagation=true; |
| 392 |
|
$jsCallback=null; |
| 393 |
|
$attr="id"; |
| 394 |
|
$hasLoader=true; |
| 395 |
|
$immediatly=true; |
| 396 |
|
$jqueryDone="html"; |
| 397 |
|
$ajaxTransition=null; |
| 398 |
|
extract($parameters); |
| 399 |
|
return $this->_add_event($element, $this->_post($url, $params, $responseElement, $jsCallback, $attr,$hasLoader,$jqueryDone,$ajaxTransition), $event, $preventDefault, $stopPropagation,$immediatly); |
| 400 |
|
} |
| 401 |
|
|
| 402 |
|
/** |
| 403 |
|
* Performs a post to $url on the click event fired on $element and pass the parameters $params |