2013-12-16 2 views
1

Вот обратный вызов, который я хочу настроить с помощью помощника Js, но я не могу найти никакой информации или примеров относительно этого.Настройка обратного вызова успеха в CakePHP с помощником Js

success: function(data) { 
    $('#EventProjectId').html(data.html); 
} 

Вот вызов Ajax, что у меня есть на данный момент:

$this->Js->get('#EventCustomerId')->event('change', 
    $this->Js->request(array(
     'controller'=>'events', 
     'action'=>'getbycustomer' 
     ), array(

     'update'=>'#EventProjectId', 
     'async' => true, 
     'method' => 'post', 
     'dataExpression' => true, 
     'data' => $this->Js->serializeForm(array(
      'isForm' => true, 
      'inline' => true 
     )) 
     ) 
    )) 
    ); 

Любая помощь очень ценится.

ответ

2
$this->Js->request(array(
     'success' => "function(data) { 
      $('#EventProjectId').html(data.html); 
     }", 
     'controller'=>'events', 
     'action'=>'getbycustomer' 
     ), array(

     'update'=>'#EventProjectId', 
     'async' => true, 
     'method' => 'post', 
     'dataExpression' => true, 
     'data' => $this->Js->serializeForm(array(
      'isForm' => true, 
      'inline' => true 
     )) 
     ) 
    )) 
    ); 
Смежные вопросы