details: https://code.openbravo.com/erp/devel/pi/rev/345215765c33 changeset: 15445:345215765c33 user: Iván Perdomo <ivan.perdomo <at> openbravo.com> date: Sat Feb 11 15:48:44 2012 +0100 summary: Issue 19728: Format js files org.openbravo.client.application - grid
details: https://code.openbravo.com/erp/devel/pi/rev/ba67efc3203a changeset: 15446:ba67efc3203a user: Iván Perdomo <ivan.perdomo <at> openbravo.com> date: Sat Feb 11 16:19:47 2012 +0100 summary: Issue 19728: Format js files org.openbravo.client.application - main details: https://code.openbravo.com/erp/devel/pi/rev/cbfa765a23c4 changeset: 15447:cbfa765a23c4 user: Iván Perdomo <ivan.perdomo <at> openbravo.com> date: Sat Feb 11 16:31:48 2012 +0100 summary: Issue 19728: Format js files org.openbravo.client.application - navbar details: https://code.openbravo.com/erp/devel/pi/rev/4cfd9a2819c4 changeset: 15448:4cfd9a2819c4 user: Iván Perdomo <ivan.perdomo <at> openbravo.com> date: Sat Feb 11 16:43:01 2012 +0100 summary: Issue 19728: Format js files org.openbravo.client.application - personalization details: https://code.openbravo.com/erp/devel/pi/rev/9c44288913ac changeset: 15449:9c44288913ac user: Iván Perdomo <ivan.perdomo <at> openbravo.com> date: Sat Feb 11 17:01:05 2012 +0100 summary: Issue 19728: Format js files org.openbravo.client.application - toolbar details: https://code.openbravo.com/erp/devel/pi/rev/90cd8fb48f1a changeset: 15450:90cd8fb48f1a user: Iván Perdomo <ivan.perdomo <at> openbravo.com> date: Sat Feb 11 17:22:32 2012 +0100 summary: Issue 19728: Format js files org.openbravo.client.application - utilities details: https://code.openbravo.com/erp/devel/pi/rev/ee3d80bd57c0 changeset: 15451:ee3d80bd57c0 user: Iván Perdomo <ivan.perdomo <at> openbravo.com> date: Sat Feb 11 17:38:16 2012 +0100 summary: Issue 19728: Fixes extra character added when reordering var declaration details: https://code.openbravo.com/erp/devel/pi/rev/950ef38c6548 changeset: 15452:950ef38c6548 user: Iván Perdomo <ivan.perdomo <at> openbravo.com> date: Sat Feb 11 17:40:36 2012 +0100 summary: Issue 19728: Format js files org.openbravo.client.application - example diffstat: modules/org.openbravo.client.application/web/org.openbravo.client.application/example/grid-example.js | 80 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js | 554 ++-- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js | 1115 +++++---- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-base-view.js | 32 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-messagebar.js | 42 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view-datasource.js | 52 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js | 1047 ++++---- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js | 331 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-tab.js | 159 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-application-menu.js | 129 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-help-about-widget.js | 64 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-logout-widget.js | 16 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-quick-launch.js | 95 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-quickrun-widget.js | 78 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-user-profile-widget.js | 180 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-manage-views-popups.js | 480 ++-- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-manage-views-toolbar.js | 169 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-manage-views.js | 231 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-personalization-treegrid.js | 249 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-personalization.js | 154 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-personalize-form-toolbar-button.js | 68 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-personalize-form.js | 767 +++--- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-action-button.js | 86 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-clone-order.js | 44 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js | 855 ++++--- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-eventhandler.js | 160 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-external-page.js | 44 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-history-manager.js | 34 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-keyboard-manager.js | 192 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-popup.js | 98 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-property-store.js | 52 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-recent-utilities.js | 47 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-remote-call-manager.js | 21 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-section-stack.js | 2 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-test-registry.js | 13 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-date.js | 47 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-number.js | 85 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js | 287 +- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-view-manager.js | 121 +- 39 files changed, 4247 insertions(+), 4033 deletions(-) diffs (truncated from 17220 to 300 lines): diff -r d3d34b7bf993 -r 950ef38c6548 modules/org.openbravo.client.application/web/org.openbravo.client.application/example/grid-example.js --- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/example/grid-example.js Sat Feb 11 15:28:57 2012 +0100 +++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/example/grid-example.js Sat Feb 11 17:40:36 2012 +0100 @@ -11,27 +11,25 @@ * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SLU - * All portions are Copyright (C) 2010 Openbravo SLU + * All portions are Copyright (C) 2010-2012 Openbravo SLU * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************ */ // it is often nicer to create a subclass than just changing // the properties of the ListGrid. A subclass can be re-used. - // OBTestSelectionGrid: The first type is the listgrid shown in the top // OBTestSelectionLayout: is the layout showing the grid and the button below it - isc.ClassFactory.defineClass('OBTestSelectionGrid', isc.ListGrid); isc.OBTestSelectionGrid.addProperties({ width: '100%', - height: '90%', // give the button some space - + height: '90%', + // give the button some space // some common settings - showFilterEditor: true, + showFilterEditor: true, filterOnKeypress: true, - + canEdit: false, alternateRecordStyles: true, canReorderFields: true, @@ -39,45 +37,45 @@ canGroupBy: false, selectionAppearance: 'checkbox', canAutoFitFields: false, - + autoFitFieldWidths: true, autoFitWidthApproach: 'title', - + // as all the data is loaded on the client // let's do these things here dataProperties: { useClientFiltering: true, useClientSorting: true }, - + // property set by creator or when instantiated // is the server side actionhandler providing the data // and executing the action actionHandler: null, - - initWidget: function(){ + + initWidget: function () { var me = this; - + // the data request calls this method, which sets the data in the grid - var callBack = function(response, data, request){ - me.dataSource = isc.DataSource.create({ - clientOnly: true, - fields: me.fields, - testData: data.list - }); - me.filterData(); - }; - + var callBack = function (response, data, request) { + me.dataSource = isc.DataSource.create({ + clientOnly: true, + fields: me.fields, + testData: data.list + }); + me.filterData(); + }; + // request the data, note the _command value OB.RemoteCallManager.call(this.actionHandler, {}, { '_command': 'data' }, callBack); - + var result = this.Super("initWidget", arguments); }, - + // enable/disable the button on selection - selectionChanged: function(){ + selectionChanged: function () { this.selectionLayout.selectionUpdated(this.getSelection().getLength()); } }); @@ -91,45 +89,47 @@ width: 600, height: 300, defaultLayoutAlign: 'center', - + gridProperties: null, buttonProperties: null, - + actionHandler: null, - + selectionGrid: null, selectionButton: null, - initWidget: function(){ + initWidget: function () { + var buttonClickCallback; + // note the actionHandler needs to be set in the grid when it gets created // read the SC documentation on what isc.addProperties does this.selectionGrid = isc.OBTestSelectionGrid.create(isc.addProperties(this.gridProperties, { actionHandler: this.actionHandler })); - + // tell the selection grid who is its owner this.selectionGrid.selectionLayout = this; this.addMembers(this.selectionGrid); - + // make some vertical space this.addMembers(isc.LayoutSpacer.create({ height: 10 })); - + // create the action button this.selectionButton = isc.Button.create(this.buttonProperties); this.selectionButton.selectionLayout = this; this.selectionButton.setDisabled(true); this.addMembers(this.selectionButton); - + // this function is called after the data has been processed // the message is set on the server - var buttonClickCallback = function(resp, data, req){ + buttonClickCallback = function (resp, data, req) { isc.say(data.message); }; - + // note it can make sense to make a process button class // which gets the name of the action handler to call - this.selectionButton.click = function(){ + this.selectionButton.click = function () { OB.RemoteCallManager.call(this.actionHandler, { selectedRecords: this.selectionLayout.selectionGrid.getSelection() }, { @@ -140,12 +140,12 @@ }; this.selectionButton.actionHandler = this.actionHandler; this.Super('initWidget', arguments); - + this.selectionGrid.focusInFilterEditor(); }, - + // disable or enable the button - selectionUpdated: function(selectedCount){ + selectionUpdated: function (selectedCount) { this.selectionButton.setDisabled(selectedCount === 0); } -}); +}); \ No newline at end of file diff -r d3d34b7bf993 -r 950ef38c6548 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 Feb 11 15:28:57 2012 +0100 +++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js Sat Feb 11 17:40:36 2012 +0100 @@ -11,7 +11,7 @@ * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SLU - * All portions are Copyright (C) 2010-2011 Openbravo SLU + * All portions are Copyright (C) 2010-2012 Openbravo SLU * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************ @@ -24,68 +24,70 @@ isc.OBGrid.addProperties({ dragTrackerMode: 'none', - + // recycle gives better performance but also results // in strange results that not all record components are // drawn when scrolling very fast recordComponentPoolingMode: 'viewport', - + showRecordComponentsByCell: true, recordComponentPosition: 'within', poolComponentsPerColumn: true, showRecordComponents: true, escapeHTML: true, bodyProperties: { - canSelectText:true, - + canSelectText: true, + // the redraw on change should not only redraw the current item // but the whole edit row, make sure that happens asynchronously - redrawFormItem: function(item, reason) { - var lg = this.grid, row = lg.getEditRow(), - col = lg.getColNum(item.getFieldName()); - + redrawFormItem: function (item, reason) { + var lg = this.grid, + row = lg.getEditRow(), + col = lg.getColNum(item.getFieldName()); + // If the user has edited the cell, or setValue() has been called on the item // we don't want a call to redraw() on the item to drop that value if (lg.getEditCol() === col) { lg.storeUpdatedEditorValue(); } - + if (row === 0 || row > 0) { - lg.fireOnPause('refreshEditRow', function() { + lg.fireOnPause('refreshEditRow', function () { lg.refreshRow(row); }); } } }, - enableShortcuts: function() { - var me = this; + enableShortcuts: function () { + var me = this, + ksAction_FocusFilter, ksAction_FocusGrid, ksAction_ClearFilter, ksAction_SelectAll, ksAction_UnselectAll; - var ksAction_FocusFilter = function() { + ksAction_FocusFilter = function () { me.focusInFirstFilterEditor(); return false; //To avoid keyboard shortcut propagation }; OB.KeyboardManager.Shortcuts.set('Grid_FocusFilter', 'OBGrid.body', ksAction_FocusFilter); - var ksAction_FocusGrid = function() { + ksAction_FocusGrid = function () { me.focus(); return false; //To avoid keyboard shortcut propagation }; OB.KeyboardManager.Shortcuts.set('Grid_FocusGrid', 'OBGrid.filter', ksAction_FocusGrid); - var ksAction_ClearFilter = function() { + ksAction_ClearFilter = function () { me.clearFilter(true); return false; //To avoid keyboard shortcut propagation }; OB.KeyboardManager.Shortcuts.set('Grid_ClearFilter', ['OBGrid.body', 'OBGrid.filter'], ksAction_ClearFilter); - var ksAction_SelectAll = function() { + ksAction_SelectAll = function () { me.selectAllRecords(); return false; //To avoid keyboard shortcut propagation }; OB.KeyboardManager.Shortcuts.set('Grid_SelectAll', 'OBGrid.body', ksAction_SelectAll); - var ksAction_UnselectAll = function() { + ksAction_UnselectAll = function () { if (me.getSelectedRecords().length > 1) { me.deselectAllRecords(); } @@ -94,12 +96,12 @@ OB.KeyboardManager.Shortcuts.set('Grid_UnselectAll', 'OBGrid.body', ksAction_UnselectAll); }, - draw : function() { + draw: function () { this.enableShortcuts(); this.Super('draw', arguments); }, - bodyKeyPress : function (event, eventInfo) { + bodyKeyPress: function (event, eventInfo) { var response = OB.KeyboardManager.Shortcuts.monitor('OBGrid.body'); if (response !== false) { response = this.Super('bodyKeyPress', arguments); @@ -107,7 +109,7 @@ return response; }, - filterFieldsKeyDown: function(item, form, keyName) { + filterFieldsKeyDown: function (item, form, keyName) { var response = OB.KeyboardManager.Shortcuts.monitor('OBGrid.filter'); if (response !== false) { ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ Openbravo-commits mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openbravo-commits
