The stores are defined in an include file.
Code:
storeTrafficDest = new Ext.data.JsonStore(
{
name: 'storeTrafficDest',
url: './ext-autojson.php?sel=trafficdest',
baseParams: {startDate: '2010-04-01', endDate: '2010-05-01', reportGranularity: 'Weekly', filterList: 'All'},
root: 'rows',
remoteSort: false,
autoLoad: false,
sortInfo:
{
field: 'location',
direction: 'ASC'
},
reportFields: 'loc_idx,cst_idx',
filterFields: 'cst_idx',
idProperty: 'loc_idx',
fields:
[
{ name: 'loc_idx', sortType: 'asInt', type: 'int' },
{ name: 'country', sortType: 'asUCString', type: 'string' },
{ name: 'location', sortType: 'asUCString', type: 'string' },
{ name: 'tot_icalls', sortType: 'asInt', type: 'int' },
{ name: 'tot_ianswd', sortType: 'asInt', type: 'int' },
{ name: 'tot_idur', sortType: 'asInt', type: 'int' },
{ name: 'iasr', sortType: 'asInt', type: 'int' },
{ name: 'iacd', sortType: 'asInt', type: 'int' },
{ name: 'tot_ocalls', sortType: 'asInt', type: 'int' },
{ name: 'tot_oanswd', sortType: 'asInt', type: 'int' },
{ name: 'tot_odur', sortType: 'asInt', type: 'int' },
{ name: 'oasr', sortType: 'asInt', type: 'int' },
{ name: 'oacd', sortType: 'asInt', type: 'int' }
],
});
storeCustTrafficDest = new Ext.data.JsonStore(
{
name: 'storeCustTrafficDest',
url: './ext-autojson.php?sel=custtrafficdest',
baseParams: {startDate: '2010-04-01', endDate: '2010-05-01', reportGranularity: 'Weekly', filterList: 'All'},
root: 'rows',
remoteSort: false,
autoLoad: false,
sortInfo:
{
field: 'location',
direction: 'ASC'
},
idProperty: 'loc_idx',
reportFields: 'loc_idx,cst_idx',
filterFields: 'cst_idx',
fields:
[
{ name: 'loc_idx', sortType: 'asInt', type: 'int' },
{ name: 'location', sortType: 'asUCString', type: 'string' },
{ name: 'tot_icalls', sortType: 'asInt', type: 'int' },
{ name: 'tot_ianswd', sortType: 'asInt', type: 'int' },
{ name: 'tot_idur', sortType: 'asInt', type: 'int' },
{ name: 'iasr', sortType: 'asInt', type: 'int' },
{ name: 'iacd', sortType: 'asInt', type: 'int' },
{ name: 'tot_ocalls', sortType: 'asInt', type: 'int' },
{ name: 'tot_oanswd', sortType: 'asInt', type: 'int' },
{ name: 'tot_odur', sortType: 'asInt', type: 'int' },
{ name: 'oasr', sortType: 'asInt', type: 'int' },
{ name: 'oacd', sortType: 'asInt', type: 'int' }
]
});
I changed the code to display both grids below each other and that works fine :
So looks like the grid and store definitions are fine.
Code:
<!-- Do NOT put any DOCTYPE here unless you want problems in IEs. -->
<html>
<!-- Each valid html page must have a head; let's create one. -->
<head>
<!-- The following line defines content type and utf-8 as character set. -->
<!-- If you want your application to work flawlessly with various local -->
<!-- characters, just make ALL strings, on the page, json and database utf-8. -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- Ext relies on its default css so include it here. -->
<!-- This must come BEFORE javascript includes! -->
<link rel="stylesheet" type="text/css" href="../../include/ext/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="../../include/ext/resources/css/xtheme-gray.css" />
<link rel="stylesheet" href="css/statusbar.css" type="text/css" />
<!-- Include here your own css files if you have them. -->
<link rel="stylesheet" href="./styles.css" type="text/css">
<!-- First of javascript includes must be an adapter... -->
<script type="text/javascript" src="../../include/ext/adapter/ext/ext-base-debug.js"></script>
<!-- ...then you need the Ext itself, either debug or production version. -->
<script type="text/javascript" src="../../include/ext/ext-all-debug.js"></script>
<script type="text/javascript" src="../../include/ext-addons/ux/GroupSummary.js"></script>
<!--
<script type="text/javascript" src="../../include/ext/src/locale/ext-lang-nl.js"></script>
-->
<!-- Include here your extended classes if you have some. -->
<script src="./ext-js/statusbar/StatusBar.js" type="text/javascript" language="javascript"></script>
<!-- Include here you application javascript file if you have it. -->
<script type="text/javascript" src="./js/genericfunctions.js"></script>
<script type="text/javascript" src="./ext-js/substores.js"></script>
<script type="text/javascript" src="./ext-js/functions.js"></script>
<!-- <script type="text/javascript" src="./ext-js/actions.js"></script> -->
<!-- Set a title for the page (id is not necessary). -->
<title id="page-title">TRS Report (Carriers->Per destination/ Per period)</title>
<!-- You can have onReady function here or in your application file. -->
<!-- If you have it in your application file delete the whole -->
<!-- following script tag as we must have only one onReady. -->
<script type="text/javascript">
// Path to the blank image must point to a valid location on your server
Ext.BLANK_IMAGE_URL = '../../include/ext/resources/images/default/s.gif';
Ext.onReady(function()
{
var reportParameters = getParams();
var reportTitle = '';
storeTrafficDest.baseParams.startDate = reportParameters['start'];
storeTrafficDest.baseParams.endDate = reportParameters['end'];
storeTrafficDest.baseParams.reportGranularity = reportParameters['granularity'];
storeTrafficDest.baseParams.filterList = reportParameters['filter'];
storeCustTrafficDest.baseParams.startDate = reportParameters['start'];
storeCustTrafficDest.baseParams.endDate = reportParameters['end'];
storeCustTrafficDest.baseParams.reportGranularity = reportParameters['granularity'];
storeCustTrafficDest.baseParams.filterList = reportParameters['filter'];
reportTitle = reportParameters['carriers'].replace(/%20/g, " ").split('_');
reportTitle += reportParameters['granularity'] + " [" + reportParameters['start'] + "-" + reportParameters['end'] +"]";
document.getElementById('reportTitle').innerHTML = reportTitle;
var report1 = new Ext.grid.GridPanel(
{
id: 'trafficDest',
renderTo: 'report1',
title: 'Traffic Destination',
store: storeTrafficDest,
loadMask: true,
enableColumnHide: false,
columnLines: true,
childReports: '',
height: 400,
columns:
[
{ header: 'LocIdx', sortable: false, dataIndex: 'loc_idx', hidden: true },
{ header: 'Country', sortable: true, dataIndex: 'country', width: 125 },
{ header: 'Location', sortable: true, dataIndex: 'location', width: 125 },
{ header: 'iCalls', sortable: true, dataIndex: 'tot_icalls', width: 75 },
{ header: 'iAnswd', sortable: true, dataIndex: 'tot_ianswd', width: 75 },
{ header: 'iMinutes', sortable: true, dataIndex: 'tot_idur', width: 75 },
{ header: 'iASR(%)', sortable: true, dataIndex: 'iasr', width: 60 },
{ header: 'iACD(m)', sortable: true, dataIndex: 'iacd', width: 60 },
{ header: 'oCalls', sortable: true, dataIndex: 'tot_ocalls', width: 75 },
{ header: 'oAnswd', sortable: true, dataIndex: 'tot_oanswd', width: 75 },
{ header: 'oMinutes', sortable: true, dataIndex: 'tot_odur', width: 75 },
{ header: 'oASR(%)', sortable: true, dataIndex: 'oasr', width: 60 },
{ header: 'oACD(m)', sortable: true, dataIndex: 'oacd', width: 60 }
],
listeners:
{
'activate': {fn:function(tab){tab.doLayout();},single: true}
}
});
var report2 = new Ext.grid.GridPanel(
{
id: 'custTrafficDest',
renderTo: 'report2',
title: 'Traffic Per Destination',
store: storeCustTrafficDest,
loadMask: true,
enableColumnHide: false,
columnLines: true,
height: 400,
columns:
[
{ header: 'LocIdx', sortable: false, dataIndex: 'loc_idx', width: 75 },
{ header: 'Location', sortable: true, dataIndex: 'location', width: 125 },
{ header: 'iCalls', sortable: true, dataIndex: 'tot_icalls', width: 75 },
{ header: 'iAnswd', sortable: true, dataIndex: 'tot_ianswd', width: 75 },
{ header: 'iMinutes', sortable: true, dataIndex: 'tot_idur', width: 75 },
{ header: 'iASR(%)', sortable: true, dataIndex: 'iasr', width: 60 },
{ header: 'iACD(m)', sortable: true, dataIndex: 'iacd', width: 60 },
{ header: 'oCalls', sortable: true, dataIndex: 'tot_ocalls', width: 75 },
{ header: 'oAnswd', sortable: true, dataIndex: 'tot_oanswd', width: 75 },
{ header: 'oMinutes', sortable: true, dataIndex: 'tot_odur', width: 75 },
{ header: 'oASR(%)', sortable: true, dataIndex: 'oasr', width: 60 },
{ header: 'oACD(m)', sortable: true, dataIndex: 'oacd', width: 60 }
],
listeners:
{
'activate': {fn:function(tab){tab.doLayout();},single: true}
}
});
storeTrafficDest.load();
storeCustTrafficDest.load();
});
</script>
<!-- Close the head -->
</head>
<!-- You can leave the body empty in many cases, or you write your content in it. -->
<body>
<div id="reportTitle"></div>
<div id="report1"></div>
<div id="report2"></div>
</body>
<!-- Close html tag at last -->
</html>