I have used dijit css for dijit/horizontalSlider in two pages , slider is getting loaded in first page but in second page getting blank. dojoz/data/DataGrid also loaded correctly in first page, but in second page getting blank.
UPDATED:
I have two buttons in home.html(parent page) and calling django templates grid.html and move.html. Here is grid.html source code
<!DOCTYPE html>
<html >
<head>
{% load staticfiles %}
<link rel="stylesheet" href="{% static 'pmda_app/dojo/../dijit/themes/claro/claro.css' %}">
<style>
@import "{% static 'pmda_app/dojox/grid/enhanced/resources/claro/EnhancedGrid.css' %}";
@import "{% static 'pmda_app/dojox/grid/enhanced/resources/EnhancedGrid_rtl.css' %}"
<script src="{% static 'pmda_app/dojo/dojo.js' %}"></script>
<script>dojoConfig = {parseOnLoad: true}</script>
<script>
dojo.require("dojox.grid.EnhancedGrid");
dojo.require("dojo.data.ItemFileWriteStore");
dojo.require("dojox.grid.enhanced.plugins.Pagination");
dojo.ready(function(){
/*set up data store*/
var data = {
identifier: 'id',
items: []
};
var data_list = [
{ col1: "normal", col2: false, col3: 'But are not followed by two hexadecimal', col4: 29.91},
{ col1: "important", col2: false, col3: 'Because a % sign always indicates', col4: 9.33},
{ col1: "important", col2: false, col3: 'Signs can be selectively', col4: 19.34}
];
var rows = 60;
for(var i=0, l=data_list.length; i<rows; i++){
data.items.push(dojo.mixin({ id: i+1 }, data_list[i%l]));
}
var store = new dojo.data.ItemFileWriteStore({data: data});
/*set up layout*/
var layout = [[
{'name': 'Column 1', 'field': 'id'},
{'name': 'Column 2', 'field': 'col2'},
{'name': 'Column 3', 'field': 'col3', 'width': '230px'},
{'name': 'Column 4', 'field': 'col4', 'width': '230px'}
]];
/*create a new grid:*/
var grid = new dojox.grid.EnhancedGrid({
id: 'grid',
store: store,
structure: layout,
rowSelector: '20px',
}},
document.createElement('div')
);
/*append the new grid to the div*/
dojo.byId("gridDiv").appendChild(grid.domNode);
/*Call startup() to render the grid*/
grid.startup();
});
</script>
</head>
<body class="claro">
<div id="gridDiv"></div>
</body>
</html>
Here is the move.html
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
{% load staticfiles %}
<title>Scaling, scrolling, and panning.</title>
<link rel="stylesheet" href="{% static 'pmda_app/dijit/tests/css/dijitTests.css' %}">
<link rel="stylesheet" href="{% static 'pmda_app/dojo/../dijit/themes/claro/claro.css' %}">
<script type="text/javascript" src="{% static 'pmda_app/dojo/dojo.js' %}" data-dojo-config="isDebug: true, parseOnLoad: true"></script>
<script>dojoConfig = {parseOnLoad: true}</script>
<script type="text/javascript">
dojo.require("dijit.form.HorizontalSlider");
dojo.require("dijit.form.HorizontalRule");
dojo.require("dijit.form.HorizontalRuleLabels");
dojo.require("dijit.form.Button");
dojo.require("dojo.parser"); // scan page for widgets
dojo.require("dojox.charting.Chart");
dojo.require("dojox.charting.axis2d.Default");
dojo.require("dojox.charting.plot2d.Areas");
dojo.require("dojox.charting.plot2d.Lines");
dojo.require("dojox.charting.action2d.MouseZoomAndPan");
dojo.require("dojox.charting.plot2d.Grid");
dojo.require("dojox.charting.action2d.Tooltip");
dojo.require("dojox.charting.themes.PlotKit.orange");
makeObjects = function(){
var data = [4,8,2,1,6,4,8,8,2,1,6,4,9,0,2,8,9,3,4,1,2,1,6,9,1,0,8,2,4,6,1,6,4,8,2,1,6,4,8,2,1,6,4,8,2,1,6,4,8,2,1,6,4,8,2,1,6,4,8,2,1];
var dates = [2013-11-19,2013-11-20,2013-11-21,2013-11-22,2013-11-25];
chart = new dojox.charting.Chart("test");
chart.setTheme(dojox.charting.themes.PlotKit.orange);
chart.addAxis("x", {
labels: dojo.map(dates, function(value, index){
return {value: index + 1, text: value}; }), minorTicks:false, stroke: "green"
})
.addAxis("y", {vertical: true, fixLower: "major", fixUpper: "major", minorTicks:false, stroke: "green", min: 0})
.addSeries("UsersGraph", data,{stroke: {color: "blue", width: 1}}, {fill: "green"});
chart.addPlot("default", {type: dojox.charting.plot2d.Lines, gap: 5});
chart.addPlot("grid", {type: dojox.charting.plot2d.Grid, hMinorLines: true});
new dojox.charting.action2d.Tooltip(chart, "default");
chart.render();
};
dojo.addOnLoad(makeObjects);
</script>
</head>
<body class="tundra">
<div id="test" style="width: 500px; height: 300px; margin: 30px auto 0px auto;"> </div>
<table>
<tr><td align="center" class="pad">ZOOM X(<span id="scaleXValue">1</span>)</td></tr>
<tr><td>
<div id="scaleXSlider" data-dojo-type="dijit/form/HorizontalSlider" class="clearfix" value="1" minimum="1" maximum="5" discreteValues="6" showButtons="false" style="width: 500px;">
<div data-dojo-type="dijit/form/HorizontalRule" container="bottomDecoration" count="5" style="height:5px;"></div>
<div data-dojo-type="dijit/form/HorizontalRuleLabels" container="bottomDecoration" minimum="1" maximum="5" count="5" constraints="{pattern: '##'}" style="height:1.2em;font-size:75%;color:gray;"></div>
</div>
</td></tr>
<tr><td align="center" class="pad">PAN X (<span id="offsetXValue">0</span>)</td></tr>
<tr><td>
<div id="offsetXSlider" dojoType="dijit.form.HorizontalSlider"
value="1" minimum="0" maximum="1000" discreteValues="1001" showButtons="false"
style="width: 500px;">
</div>
</td></tr>
</table>
</body>
</html>
First I have clicked on grid.html and it displayed the data correctly, after that clicked on move.html for chart with horizontal sliders, chart came properly but no sliders are there.
If I clicked move.html first time it is wokring fine(getting chart and sliders also)