rkanemeier
01-14-2011, 08:58 AM
I am having problems passing parms from a javascript function in first grid to a javascript function in the second grid. I created a cellclick listener that will call a javascript function which will open up a new window that in turn calls another web page that will generate the new grid, but the parms are undefined.
Here is the code inside of grid1 that calls the javascript to launch the new grid:
function launchCWFdetail (parmField,parmValue) {
alert('launchCWFdetail called with parmField = ' + parmField + ' and parmValue = ' + parmValue);
var CWFdetailURL = 'http://chc4001:7021/valence/vvlogin.pgm?user=GenRpt&password=MedMC&environment=1&option=1014&portal=false&parmField=' + parmField + '&parmValue=' + parmValue;
alert(CWFdetailURL);
var dtlTimeOutValue = 4000;
try{
this.CWFdetailWindow.loadDetail(this.parmField,thi s.parmValue);
} catch (e) {
this.CWFdetailWindow = window.open(CWFdetailURL,'CWFdetail','width=600,me nubar=1,status=1,personalbar=1,toolbar=1,resizable =1,location=0');
setTimeout("this.CWFdetailWindow.loadDetail(this.parmField,thi s.parmValue)",dtlTimeOutValue);
};
this.CWFdetailWindow.focus();
}
new Ext.Viewport({
layout: 'fit',
items: [{
xtype: 'grid',
id: 'grid01',
title: 'Please wait while drill down grid loads....',
store: dsGrid01,
stripeRows: true,
columnLines: true,
listeners:{
cellclick: function (grid,rowIndex, columnIndex,e){
var record = grid.getStore().getAt(rowIndex);
var fieldName = grid.getColumnModel().getDataIndex(columnIndex);
var fieldData = record.get(fieldName);
//alert('Row: ' + rowIndex + ' Col:' + columnIndex + ' Field: ' + fieldName + ' Value: ' + fieldData);
launchCWFdetail(fieldName, fieldData);
}
},
.....
Here is the code for grid2:
// This function serves to circumvent the problem of launching another page
// from a Valance app outside the valence portal.
window.loadDetail = function(inField,inValue) {
alert('CWFDRILL04.html was called with inField=' + inField + ' and inValue=' + inValue);
dsClaimDetailGrid.baseParams = {
pgm: 'CWFDRILL04',
action: 'getRecords',
field: inField,
value: inValue,
limit: 25,
start: 0
};
Ext.getCmp('claimDetailGrid').setTitle('<div style="text-align:center">Claim Detail for </div>');
dsClaimDetailGrid.reload();
};
The values for parmField and parmValue are fine. I have a bad feeling I am running into problems with the window object since it is being used in both grids.
Here is the code inside of grid1 that calls the javascript to launch the new grid:
function launchCWFdetail (parmField,parmValue) {
alert('launchCWFdetail called with parmField = ' + parmField + ' and parmValue = ' + parmValue);
var CWFdetailURL = 'http://chc4001:7021/valence/vvlogin.pgm?user=GenRpt&password=MedMC&environment=1&option=1014&portal=false&parmField=' + parmField + '&parmValue=' + parmValue;
alert(CWFdetailURL);
var dtlTimeOutValue = 4000;
try{
this.CWFdetailWindow.loadDetail(this.parmField,thi s.parmValue);
} catch (e) {
this.CWFdetailWindow = window.open(CWFdetailURL,'CWFdetail','width=600,me nubar=1,status=1,personalbar=1,toolbar=1,resizable =1,location=0');
setTimeout("this.CWFdetailWindow.loadDetail(this.parmField,thi s.parmValue)",dtlTimeOutValue);
};
this.CWFdetailWindow.focus();
}
new Ext.Viewport({
layout: 'fit',
items: [{
xtype: 'grid',
id: 'grid01',
title: 'Please wait while drill down grid loads....',
store: dsGrid01,
stripeRows: true,
columnLines: true,
listeners:{
cellclick: function (grid,rowIndex, columnIndex,e){
var record = grid.getStore().getAt(rowIndex);
var fieldName = grid.getColumnModel().getDataIndex(columnIndex);
var fieldData = record.get(fieldName);
//alert('Row: ' + rowIndex + ' Col:' + columnIndex + ' Field: ' + fieldName + ' Value: ' + fieldData);
launchCWFdetail(fieldName, fieldData);
}
},
.....
Here is the code for grid2:
// This function serves to circumvent the problem of launching another page
// from a Valance app outside the valence portal.
window.loadDetail = function(inField,inValue) {
alert('CWFDRILL04.html was called with inField=' + inField + ' and inValue=' + inValue);
dsClaimDetailGrid.baseParams = {
pgm: 'CWFDRILL04',
action: 'getRecords',
field: inField,
value: inValue,
limit: 25,
start: 0
};
Ext.getCmp('claimDetailGrid').setTitle('<div style="text-align:center">Claim Detail for </div>');
dsClaimDetailGrid.reload();
};
The values for parmField and parmValue are fine. I have a bad feeling I am running into problems with the window object since it is being used in both grids.