rickg
11 Jan 2010, 11:40 PM
Hi
In IE6/7/8 I'm double clicking on a grid row (only seems to happen on a double click), which in turn loads a new dialog window, the window then closes via a close button. This all worked fine until upgrading to extjs3.1. Now I get the following javascript error immediately after closing the window! : 'ParentNode is null or not an object'.
I've browsed the internet and forum but can't find any usful info, apart from that it's an internet explorer issue (works ok in firefox). I'm presuming 3.1 is now calling the same event twice which causes the javascript error.
Since this worked in 3.0, has anybody any ideas on a workaround/fix??? I've included the relevant snippets of the code below:
cheers
Rick
//private method to handle Search grid double-click
function gridJobOrder_CellDblClick(objGrd, rowidx, colidx, e) {
var stor = objGrd.getStore();
var jobOrderID = -1;
//get iorgid
if (stor != null) {
jobOrderID = parseInt(stor.getAt(rowidx).data.JobOrderID);
}
if (jobOrderID > 0) {
var maintenanceRequestID = parseInt(stor.getAt(rowidx).data.MaintenanceRequestID);
LoadJobOrder(jobOrderID, maintenanceRequestID);
}
else {
//Error
alert('Invalid JobOrderID (id=' + jobOrderID + ') returned at cell index!');
}
};
function LoadJobOrder(jobOrderID, maintenanceRequestID) {
var objJobOrderDialog = new CHIMS.Maintenance.CJobOrderDialog();
var jobOrderWindow = objJobOrderDialog.GetInstance(jobOrderID, maintenanceRequestID);
jobOrderWindow.show();
}
function ClosePanelPrompt(objPanel, maintenanceForm, maintenanceRequestID) {
//Check to see if form has changed
if (maintenanceForm.getForm().isDirty()) {
Ext.Msg.show({
title: 'Unsaved Changes!',
msg: 'The maintenance request details have changed. <br/><br/>Do you want to save the changes?',
buttons: Ext.Msg.YESNOCANCEL,
icon: Ext.Msg.WARNING,
fn: function(btn, text) {
if (btn == 'yes') {
_closeOnSave = true;
//save before continuing
saveMaintenance(maintenanceForm, maintenanceRequestID);
}
else if (btn == 'no') {
var extTabPanel = objPanel.findParentByType(Ext.TabPanel);
extTabPanel.remove(objPanel, true);
}
else {
//do nothing
}
}
});
}
else {
return true;
}
//always return false at the end otherwise Panel will always close
//when the prompt is displayed
return false;
};
In IE6/7/8 I'm double clicking on a grid row (only seems to happen on a double click), which in turn loads a new dialog window, the window then closes via a close button. This all worked fine until upgrading to extjs3.1. Now I get the following javascript error immediately after closing the window! : 'ParentNode is null or not an object'.
I've browsed the internet and forum but can't find any usful info, apart from that it's an internet explorer issue (works ok in firefox). I'm presuming 3.1 is now calling the same event twice which causes the javascript error.
Since this worked in 3.0, has anybody any ideas on a workaround/fix??? I've included the relevant snippets of the code below:
cheers
Rick
//private method to handle Search grid double-click
function gridJobOrder_CellDblClick(objGrd, rowidx, colidx, e) {
var stor = objGrd.getStore();
var jobOrderID = -1;
//get iorgid
if (stor != null) {
jobOrderID = parseInt(stor.getAt(rowidx).data.JobOrderID);
}
if (jobOrderID > 0) {
var maintenanceRequestID = parseInt(stor.getAt(rowidx).data.MaintenanceRequestID);
LoadJobOrder(jobOrderID, maintenanceRequestID);
}
else {
//Error
alert('Invalid JobOrderID (id=' + jobOrderID + ') returned at cell index!');
}
};
function LoadJobOrder(jobOrderID, maintenanceRequestID) {
var objJobOrderDialog = new CHIMS.Maintenance.CJobOrderDialog();
var jobOrderWindow = objJobOrderDialog.GetInstance(jobOrderID, maintenanceRequestID);
jobOrderWindow.show();
}
function ClosePanelPrompt(objPanel, maintenanceForm, maintenanceRequestID) {
//Check to see if form has changed
if (maintenanceForm.getForm().isDirty()) {
Ext.Msg.show({
title: 'Unsaved Changes!',
msg: 'The maintenance request details have changed. <br/><br/>Do you want to save the changes?',
buttons: Ext.Msg.YESNOCANCEL,
icon: Ext.Msg.WARNING,
fn: function(btn, text) {
if (btn == 'yes') {
_closeOnSave = true;
//save before continuing
saveMaintenance(maintenanceForm, maintenanceRequestID);
}
else if (btn == 'no') {
var extTabPanel = objPanel.findParentByType(Ext.TabPanel);
extTabPanel.remove(objPanel, true);
}
else {
//do nothing
}
}
});
}
else {
return true;
}
//always return false at the end otherwise Panel will always close
//when the prompt is displayed
return false;
};