=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/util/commons.js' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/util/commons.js 2010-02-03 11:08:38 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/util/commons.js 2010-02-03 16:07:25 +0000 @@ -593,3 +593,34 @@ $( "div#loaderDiv" ).hide(); $( "div#contentDiv" ).show(); } + +/** + * Deletes and removes an item from a table. The table row to be removed must have + * an identifier on the form "tr[itemId]". + * + * @param itemId the item identifier. + * @param itemName the item name. + * @param message the confirmation message. + * @param action the server action url for deleting the item. + */ +function removeItem( itemId, itemName, message, action ) +{ + var result = window.confirm( i18n_confirm_delete + "\n\n" + itemName ); + + if ( result ) + { + $.ajax({ + "url": action, + "data": { "id": itemId }, + "success": function() + { + $( "tr#tr" + itemId ).remove(); + + $( "table.listTable tbody tr" ).removeClass( "listRow listAlternateRow" ); + $( "table.listTable tbody tr:odd" ).addClass( "listAlternateRow" ); + $( "table.listTable tbody tr:even" ).addClass( "listRow" ); + + } + }); + } +} === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementGroup.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementGroup.vm 2010-02-03 14:17:49 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementGroup.vm 2010-02-03 16:07:25 +0000 @@ -20,20 +20,14 @@