Welcome Guest, Not a member yet? Register   Sign In
passing a string to a view
#4

I think it may have worked. Not really sure since I can't debug javascript code in a View (xdebug/phpStorm). What I'd like to do is take the javascript out of view configure_chart and move it to a javascript file. Notice I left a few lines to register the callback. I know I can get the javascript code in the view file to run by doing
$this->load->view('configure_chart', $data);

But how can I get the drawChart() in javascript_funcs() to run?

Here is the way the View is now

<html>
<head>
<br><br><br><br><br><br>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load('current', {packages:["orgchart"]});
google.charts.setOnLoadCallback(drawChart);

</script>
</head>

<!--Div that will hold the pie chart-->
<br><br><br>

<body>
<div id="chart_div"></div>
</body>

I moved the drawChart into my javascript_funcs file. How do I invoke drawChart when it is in its own javascript file? And does string passing still work?
proof that an old dog can learn new tricks
Reply


Messages In This Thread
passing a string to a view - by richb201 - 01-17-2018, 11:12 PM
RE: passing a string to a view - by jreklund - 01-18-2018, 02:09 AM
RE: passing a string to a view - by InsiteFX - 01-18-2018, 04:37 AM
RE: passing a string to a view - by richb201 - 01-18-2018, 09:52 AM
RE: passing a string to a view - by richb201 - 01-18-2018, 12:08 PM
RE: passing a string to a view - by jreklund - 01-18-2018, 12:21 PM
RE: passing a string to a view - by richb201 - 01-18-2018, 02:48 PM
RE: passing a string to a view - by jreklund - 01-18-2018, 03:17 PM
RE: passing a string to a view - by richb201 - 01-18-2018, 03:47 PM
RE: passing a string to a view - by jreklund - 01-19-2018, 12:53 AM
RE: passing a string to a view - by richb201 - 01-19-2018, 01:35 AM
RE: passing a string to a view - by jreklund - 01-19-2018, 04:37 AM
RE: passing a string to a view - by richb201 - 01-26-2018, 11:49 PM
RE: passing a string to a view - by richb201 - 01-28-2018, 09:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB