details: https://code.openbravo.com/erp/devel/pi/rev/4f04bb194fbe changeset: 15192:4f04bb194fbe user: Guillermo Álvarez de Eulate <guillermo.alvarez <at> openbravo.com> date: Thu Jan 19 11:38:26 2012 +0100 summary: Fixed issue 19264: The notes behavior has been corrected
details: https://code.openbravo.com/erp/devel/pi/rev/7246b6950ddd changeset: 15193:7246b6950ddd user: Guillermo Álvarez de Eulate <guillermo.alvarez <at> openbravo.com> date: Thu Jan 19 10:42:26 2012 +0100 summary: Fixed Issue 0018064: Loading text is shown while linked items are being loaded diffstat: modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-linked-items.js | 35 +++++++++- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-notes.js | 14 ++- 2 files changed, 41 insertions(+), 8 deletions(-) diffs (137 lines): diff -r f37e4bad23ee -r 7246b6950ddd modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-linked-items.js --- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-linked-items.js Tue Jan 24 18:13:30 2012 +0100 +++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-linked-items.js Thu Jan 19 10:42:26 2012 +0100 @@ -165,7 +165,8 @@ useSimpleHttp: true, actionURL: actionURL }; - + this.linkedItemCategoryListGrid.setData([]); + this.linkedItemCategoryListGrid.showLoadingMessage(); isc.RPCManager.sendRequest(reqObj); }, @@ -215,6 +216,8 @@ useSimpleHttp: true, actionURL: actionURL }; + this.linkedItemListGrid.setData([]); + this.linkedItemListGrid.showLoadingMessage(); isc.RPCManager.sendRequest(reqObj); } }, @@ -261,6 +264,8 @@ showFilterEditor: true, selectionType: 'single', filterOnKeypress: true, + loadingDataMessage: OB.I18N.getLabel('OBUISC_ListGrid.loadingDataMessage'), + emptyDataMessage: OB.I18N.getLabel('OBUIAPP_LinkedItemsEmptyMessage'), emptyMessage: OB.I18N.getLabel('OBUIAPP_LinkedItemsEmptyMessage'), layout: this, recordClick: 'this.layout.openLinkedItemInNewWindow(record)', @@ -271,6 +276,18 @@ filterData: function(criteria, callback, requestProperties){ this.checkShowFilterFunnelIcon(criteria); return this.Super('filterData', arguments); + }, + showLoadingMessage: function () { + this.emptyMessage = this.loadingDataMessage; + }, + showNoRowsMessage: function () { + this.emptyMessage = this.emptyDataMessage; + }, + dataArrived: function (startRow, endRow) { + if (startRow === 0 && endRow === -1) { + this.showNoRowsMessage(); + } + return this.Super('dataArrived', arguments); } }); @@ -293,6 +310,8 @@ height: 300, dataSource: this.linkedItemCategoryDS, layout: this, + emptyDataMessage: this.emptyMessage, + loadingDataMessage: OB.I18N.getLabel('OBUISC_ListGrid.loadingDataMessage'), recordClick: 'this.layout.loadLinkedItems(record)', showFilterEditor: true, selectionType: 'single', @@ -305,6 +324,18 @@ filterData: function(criteria, callback, requestProperties){ this.checkShowFilterFunnelIcon(criteria); return this.Super('filterData', arguments); + }, + showLoadingMessage: function () { + this.emptyMessage = this.loadingDataMessage; + }, + showNoRowsMessage: function () { + this.emptyMessage = this.emptyDataMessage; + }, + dataArrived: function (startRow, endRow) { + if (startRow === 0 && endRow === -1) { + this.showNoRowsMessage(); + } + return this.Super('dataArrived', arguments); } }); @@ -420,4 +451,4 @@ return false; } -}); +}); \ No newline at end of file diff -r f37e4bad23ee -r 7246b6950ddd modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-notes.js --- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-notes.js Tue Jan 24 18:13:30 2012 +0100 +++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-notes.js Thu Jan 19 10:42:26 2012 +0100 @@ -184,7 +184,7 @@ * Returns Notes data source. */ getNoteDataSource : function() { - return isc.DataSource.getDataSource(this.noteDSId); + return this.noteListGrid.dataSource; }, /** @@ -193,9 +193,6 @@ initWidget : function() { this.Super('initWidget', arguments); - // register note DS - OB.Datasource.get(this.noteDSId); - var hLayout = isc.HLayout.create({ width : '50%', height : '100%', @@ -260,7 +257,6 @@ alternateRecordStyles : false, autoFetchData : true, baseStyle : 'OBNoteListGridCell', - dataSource : this.noteDSId, fixedRecordHeights : false, filterOnKeypress : true, headerHeight : 0, @@ -272,6 +268,10 @@ showEmptyMessage : false, styleName : 'OBNoteListGrid', wrapCells : true, + + setDataSource: function (dataSource, fields) { + this.Super('setDataSource', [dataSource, this.fields]); + }, fetchData : function(criteria, callback, requestProperties) { if (this.layout.getForm() && this.layout.getForm().noteSection && @@ -363,7 +363,9 @@ }); this.addMember(this.noteListGrid); - + + // register note DS + OB.Datasource.get(this.noteDSId, this.noteListGrid, null, true); }, /** ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ Openbravo-commits mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openbravo-commits
