From 3f9af3be9259ca75a519991e22650ca5fcf46004 Mon Sep 17 00:00:00 2001 From: marcelo Date: Mon, 15 Apr 2013 10:35:12 -0400 Subject: [PATCH] BUG 11086 "Rows are being ignored after adding them next to an empty row" SOLVED -When you try to add a row into a pmTable, if you leave an empty row the next added rows are being ignored and not saved. -Solved, The final user cant leave a row without at least the primary keys columns filled up, to be saved and if by accident the user leaves an empty row the aplication shows up an error message. --- workflow/engine/templates/pmTables/data.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/workflow/engine/templates/pmTables/data.js b/workflow/engine/templates/pmTables/data.js index 1d243f4ee..8f76d74c2 100755 --- a/workflow/engine/templates/pmTables/data.js +++ b/workflow/engine/templates/pmTables/data.js @@ -188,7 +188,8 @@ Ext.onReady(function(){ editor = new Ext.ux.grid.RowEditor({ saveText : _("ID_UPDATE"), listeners : { - + beforeedit:function(){ + } } }); } @@ -213,10 +214,10 @@ Ext.onReady(function(){ return false; - PMExt.error(_('ID_ERROR'), msg); + PMExt.error(_('ID_ERROR'), msg); infoGrid.store.reload(); }); - + E var proxy = new Ext.data.HttpProxy({ //url: '../pmTablesProxy/getData?id=' + tableDef.ADD_TAB_UID api: { @@ -397,12 +398,17 @@ NewPMTableRow = function(){ var row = new PMRow(new props); len = infoGrid.getStore().data.length; + if (infoGrid.store.getAt(len-1).data[tableDef.FIELDS[0].FLD_NAME]=="") { + PMExt.error( _('ID_ERROR'), _('ID_EMPTY_ROW')); + store.load(); + } else{ - editor.stopEditing(); - store.insert(len, row); - infoGrid.getView().refresh(); - infoGrid.getSelectionModel().selectRow(len); - editor.startEditing(len); + editor.stopEditing(); + store.insert(len, row); + infoGrid.getView().refresh(); + infoGrid.getSelectionModel().selectRow(len); + editor.startEditing(len); + } }; //Load PM Table Edition Row Form