Monday, May 27, 2013

CakePHP, Google Charts Plugin and JsHelper

i wish select an element of dropdownlist (choose a Project) and with JSHELPER (ajax) update the GRAPH that show statistics of this Project.

I can choose the Project and through the 'POST' I can generate the array graph, but i cannot show the GRAPH. I tested without JSHELPER and show my Graph.

MY VIEW CODE:

    <b>ESCOLHA O PROJETO: </b>       <?php      echo $this->Form->select('projects', array($projects), array('multiple' => false,          'class' => 'span2',          'id' => 'projectsTest'));      ?>      </br>         <div id="chart_div" >           </div>      <?php  $this->Js->get('#projectsTest')->event('change', $this->Js->request(array(              'controller' => 'Registos',              'action' => 'timePerProjectIssueTypeChart'                  ), array(              'update' => '#chart_div',              'async' => true,              'method' => 'post',              'dataExpression' => true,              'data' => $this->Js->serializeForm(array(                  'isForm' => true,                  'inline' => true              ))  )));

?> MY VIEW TIME_PER_PROJECT_ISSUE_TYPE_CHART

<div id="chart_div" >   <?php                echo $this->GoogleChart->createJsChart($timePerProjectIssueTypeChart);              ?>    </div>

I do not put the code of the controllers, because individually tested and are working.

Thanks

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments: