details: https://code.openbravo.com/erp/devel/pi/rev/61b5386aec1c
changeset: 13839:61b5386aec1c
user: Martin Taal <martin.taal <at> openbravo.com>
date: Tue Sep 27 09:52:32 2011 +0200
summary: Prevent js errors when closing a window
diffstat:
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js
| 2 +-
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
| 16 +++++----
2 files changed, 10 insertions(+), 8 deletions(-)
diffs (45 lines):
diff -r 343fb7cd2f2f -r 61b5386aec1c
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js
Mon Sep 26 19:21:16 2011 +0200
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js
Tue Sep 27 09:52:32 2011 +0200
@@ -157,7 +157,7 @@
initWidget: function(){
// prevent the value to be displayed in case of a link
- var i, thisGrid = this, field,
+ var i, thisGrid = this, length, field,
formatCellValueFunction = function(value, record, rowNum, colNum, grid){
return '';
};
diff -r 343fb7cd2f2f -r 61b5386aec1c
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
Mon Sep 26 19:21:16 2011 +0200
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
Tue Sep 27 09:52:32 2011 +0200
@@ -721,7 +721,7 @@
// anyway
if (this.view.parentProperty && (!this.data || !this.data.getLength ||
this.data.getLength() === 0)) {
selectedValues = this.view.parentView.viewGrid.getSelectedRecords();
- if (!this.isOpenDirectMode && selectedValues.length === 0) {
+ if (selectedValues && !this.isOpenDirectMode && selectedValues.length
=== 0) {
if (callback) {
callback();
}
@@ -1032,12 +1032,14 @@
if (this.view.parentProperty && !this.isOpenDirectMode) {
selectedValues = this.view.parentView.viewGrid.getSelectedRecords();
var parentPropertyFilterValue = -1;
- if (selectedValues.length === 0) {
- parentPropertyFilterValue = '-1';
- } else if (selectedValues.length > 1) {
- parentPropertyFilterValue = '-1';
- } else {
- parentPropertyFilterValue = selectedValues[0][OB.Constants.ID];
+ if (selectedValues) {
+ if (selectedValues.length === 0) {
+ parentPropertyFilterValue = '-1';
+ } else if (selectedValues.length > 1) {
+ parentPropertyFilterValue = '-1';
+ } else {
+ parentPropertyFilterValue = selectedValues[0][OB.Constants.ID];
+ }
}
this.view.parentRecordId = parentPropertyFilterValue;
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits