delayed load of data on cum_flex
Ajax call to load data for cumulative flex chart. It works. Yay!
This commit is contained in:
@@ -6,8 +6,23 @@
|
||||
|
||||
{% block content %}
|
||||
|
||||
{{ js_res | safe }}
|
||||
{{ css_res| safe }}
|
||||
|
||||
<div id="id_css_res">
|
||||
<link rel="stylesheet" href="/static/css/bokeh-0.12.3.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="/static/css/bokeh-widgets-0.12.3.min.css" type="text/css" />
|
||||
</div>
|
||||
<div id="id_js_res">
|
||||
<script
|
||||
type="text/javascript" src="/static/js/bokeh-0.12.3.min.js">
|
||||
</script>
|
||||
<script
|
||||
type="text/javascript" src="/static/js/bokeh-widgets-0.12.3.min.js">
|
||||
</script>
|
||||
<script async="true" type="text/javascript">
|
||||
Bokeh.set_log_level("info");
|
||||
</script>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
|
||||
<script>
|
||||
@@ -58,13 +73,10 @@
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="/static/js/bokeh-0.12.3.min.js"></script>
|
||||
<script type="text/javascript" src="/static/js/bokeh-widgets-0.12.3.min.js"></script>
|
||||
<script async="true" type="text/javascript">
|
||||
Bokeh.set_log_level("info");
|
||||
</script>
|
||||
|
||||
{{ interactiveplot |safe }}
|
||||
<div id="id_script">
|
||||
|
||||
</div>
|
||||
|
||||
<style>
|
||||
/* Need this to get the page in "desktop mode"; not having an infinite height.*/
|
||||
@@ -74,11 +86,7 @@
|
||||
|
||||
<div id="title" class="grid_12 alpha">
|
||||
<div class="grid_10 alpha">
|
||||
{% if theuser %}
|
||||
<h3>{{ theuser.first_name }}'s Stroke Analysis</h3>
|
||||
{% else %}
|
||||
<h3>{{ user.first_name }}'s Stroke Analysis</h3>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
<div class="grid_2 omega">
|
||||
{% if user.is_authenticated and user|is_manager %}
|
||||
@@ -99,7 +107,6 @@
|
||||
|
||||
<div class="grid_12 alpha">
|
||||
<div id="form" class="grid_6 alpha">
|
||||
<p>Warning: Large date ranges may take a long time to load. Huge date ranges may crash your browser.</p>
|
||||
<form enctype="multipart/form-data" action="{{ formloc }}" method="post">
|
||||
{% csrf_token %}
|
||||
<div class="grid_2 alpha">
|
||||
@@ -229,10 +236,33 @@
|
||||
|
||||
|
||||
|
||||
<div id="graph" class="grid_12 alpha">
|
||||
<div id="id_chart" class="grid_12 alpha">
|
||||
|
||||
{{ the_div|safe }}
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<script type='text/javascript'
|
||||
src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js'>
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(function($) {
|
||||
console.log('loading script');
|
||||
$.getJSON(window.location.protocol + '//'+window.location.host + '/rowers/flexalldata', function(json) {
|
||||
var counter=0;
|
||||
var script = json.script;
|
||||
var div = json.div;
|
||||
$("#id_sitready").remove();
|
||||
$("#id_chart").append(div);
|
||||
console.log(div);
|
||||
$("#id_script").append("<script>"+script+"</s"+"cript>");
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user