details: /erp/devel/pi/rev/8fda2e8ab4c9
changeset: 13079:8fda2e8ab4c9
user: Martin Taal <martin.taal <at> openbravo.com>
date: Sat Jul 02 16:41:15 2011 +0200
summary: Related to issue 17836: Add Jump-to-selected-row in grid
details: /erp/devel/pi/rev/7c5f9bf662ac
changeset: 13080:7c5f9bf662ac
user: Martin Taal <martin.taal <at> openbravo.com>
date: Sat Jul 02 16:42:08 2011 +0200
summary: Related to issue 17853: ESC to cancel does not work for read-only
rows when edited
Added check on ctrl, alt, shft keys and return false
details: /erp/devel/pi/rev/f16df639d37d
changeset: 13081:f16df639d37d
user: Martin Taal <martin.taal <at> openbravo.com>
date: Sat Jul 02 16:43:45 2011 +0200
summary: Related to issue 17853: ESC to cancel does not work for read-only
rows when edited, Related to issue 17836: Add Jump-to-selected-row in grid
Added check on ctrl, shft, alt and return false
Made changes for 17836 to have style controlled through the sin
diffstat:
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js
| 28 ++++-----
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
| 19 +++---
modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/ob-grid-styles.js
| 2 +
3 files changed, 24 insertions(+), 25 deletions(-)
diffs (140 lines):
diff -r 44f9c43a4fe3 -r f16df639d37d
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
Sat Jul 02 16:29:42 2011 +0200
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js
Sat Jul 02 16:43:45 2011 +0200
@@ -33,26 +33,23 @@
escapeHTML: true,
bodyKeyPress : function (event, eventInfo) {
- if (event.keyName === 'F' &&
- (isc.EventHandler.ctrlKeyDown() && !isc.EventHandler.altKeyDown() &&
isc.EventHandler.shiftKeyDown())) {
+ var cltrAltShiftDown = isc.EventHandler.ctrlKeyDown() ||
isc.EventHandler.altKeyDown() || isc.EventHandler.shiftKeyDown();
+ if (event.keyName === 'F' && !cltrAltShiftDown) {
this.focusInFirstFilterEditor();
return false;
}
- if (event.keyName === 'Delete' &&
- (!isc.EventHandler.ctrlKeyDown() && isc.EventHandler.altKeyDown() &&
!isc.EventHandler.shiftKeyDown())) {
+ if (event.keyName === 'Delete' && !cltrAltShiftDown) {
this.clearFilter(true);
return false;
}
- if (event.keyName === 'A' &&
- (!isc.EventHandler.ctrlKeyDown() && isc.EventHandler.altKeyDown() &&
isc.EventHandler.shiftKeyDown())) {
+ if (event.keyName === 'A' && !cltrAltShiftDown) {
this.selectAllRecords();
return false;
}
- if (event.keyName === 'N' &&
- (!isc.EventHandler.ctrlKeyDown() && isc.EventHandler.altKeyDown() &&
isc.EventHandler.shiftKeyDown())) {
+ if (event.keyName === 'N' && !cltrAltShiftDown) {
if (this.getSelectedRecords().length > 1) {
this.deselectAllRecords();
}
@@ -129,23 +126,22 @@
};
setFieldsKeyDown = function(item, form, keyName) {
- if (event.keyName === 'Escape' && this.getEditForm()) {
+ var cltrAltShiftDown = isc.EventHandler.ctrlKeyDown() ||
isc.EventHandler.altKeyDown() || isc.EventHandler.shiftKeyDown();
+
+ if (event.keyName === 'Escape' && !cltrAltShiftDown &&
this.getEditForm()) {
this.cancelEditing();
- return;
+ return false;
}
- if (isc.EventHandler.getKeyName() === 'Delete' &&
- (!isc.EventHandler.ctrlKeyDown() && isc.EventHandler.altKeyDown() &&
!isc.EventHandler.shiftKeyDown())) {
+ if (isc.EventHandler.getKeyName() === 'Delete' && !cltrAltShiftDown) {
thisGrid.clearFilter(true);
return false;
}
- if (isc.EventHandler.getKeyName() === 'Escape' &&
- (!isc.EventHandler.ctrlKeyDown() && !isc.EventHandler.altKeyDown() &&
!isc.EventHandler.shiftKeyDown())) {
+ if (isc.EventHandler.getKeyName() === 'Escape' && !cltrAltShiftDown) {
thisGrid.focus();
return false;
}
- if (isc.EventHandler.getKeyName() === 'Tab' &&
- (!isc.EventHandler.ctrlKeyDown() && !isc.EventHandler.altKeyDown())) {
+ if (isc.EventHandler.getKeyName() === 'Tab' && !cltrAltShiftDown) {
return false; // To avoid strange double field jump while pressing Tab
Key
}
return this.Super('keyPress', arguments);
diff -r 44f9c43a4fe3 -r f16df639d37d
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
Sat Jul 02 16:29:42 2011 +0200
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
Sat Jul 02 16:43:45 2011 +0200
@@ -426,14 +426,15 @@
},
keyPress: function() {
- var event = isc.EventHandler.lastEvent, editRow;
+ var event = isc.EventHandler.lastEvent, editRow,
+ cltrAltShiftDown = isc.EventHandler.ctrlKeyDown() ||
isc.EventHandler.altKeyDown() || isc.EventHandler.shiftKeyDown();
- if (event.keyName === 'Escape' && this.getEditForm()) {
+ if (event.keyName === 'Escape' && !cltrAltShiftDown && this.getEditForm())
{
this.cancelEditing();
- return;
+ return false;
}
- if (event.keyName === 'Arrow_Up' && this.getEditForm()) {
+ if (event.keyName === 'Arrow_Up' && !cltrAltShiftDown &&
this.getEditForm()) {
// editing can be cancelled as all fields are
// non-editable anyway if we get here...
editRow = this.getEditRow();
@@ -441,10 +442,10 @@
if (editRow) {
this.startEditing(editRow - 1);
}
- return;
+ return false;
}
- if (event.keyName === 'Arrow_Down' && this.getEditForm()) {
+ if (event.keyName === 'Arrow_Down' && !cltrAltShiftDown &&
this.getEditForm()) {
// editing can be cancelled as all fields are
// non-editable anyway if we get here...
editRow = this.getEditRow();
@@ -452,7 +453,7 @@
if (editRow || editRow === 0) {
this.startEditing(editRow + 1);
}
- return;
+ return false;
}
return this.Super('keyPress', arguments);
@@ -1227,14 +1228,14 @@
return OB.I18N.getLabel('OBUIAPP_ClickSelectedCount');
};
}
- fld.textBoxStyle = 'OBGridFilterStaticTextClickable';
+ fld.textBoxStyle = fld.clickableTextBoxStyle;
fld.updateState();
}
} else {
if (this.filterEditor && this.filterEditor.getEditForm()) {
fld =
this.filterEditor.getEditForm().getField(this.getCheckboxField().name);
if (fld) {
- fld.textBoxStyle = 'OBGridFilterStaticText';
+ fld.textBoxStyle = fld.nonClickableTextBoxStyle;
fld.updateState();
}
}
diff -r 44f9c43a4fe3 -r f16df639d37d
modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/ob-grid-styles.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/ob-grid-styles.js
Sat Jul 02 16:29:42 2011 +0200
+++
b/modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/ob-grid-styles.js
Sat Jul 02 16:43:45 2011 +0200
@@ -184,6 +184,8 @@
isc.OBViewGrid.changeDefaults('checkboxFieldDefaults', {
filterEditorProperties: {
textBoxStyle: 'OBGridFilterStaticText',
+ nonClickableTextBoxStyle: 'OBGridFilterStaticText',
+ clickableTextBoxStyle: 'OBGridFilterStaticTextClickable',
textAlign: 'center'
}
});
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits