← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2333: Fix bug : After removing any object ( user role, organisation, ... ) , the object deleted but afte...

 

------------------------------------------------------------
revno: 2333
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: trunk
timestamp: Fri 2010-10-08 14:03:08 +0700
message:
  Fix bug : After removing any object ( user role, organisation, ... ) ,the object deleted but after clicking sort by button it will appear again.
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js	2010-10-07 12:19:06 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js	2010-10-08 07:03:08 +0000
@@ -721,25 +721,31 @@
     	        "id": itemId   
     	    },
     	    function( json )
-    	    {
+    	    { 
     	    	if ( json.response == "success" )
     	    	{
-    	    		jQuery( "tr#tr" + itemId ).remove();
-                
-	                jQuery( "table.listTable tbody tr" ).removeClass( "listRow listAlternateRow" );
+					jQuery( "tr#tr" + itemId ).remove();
+	                
+					jQuery( "table.listTable tbody tr" ).removeClass( "listRow listAlternateRow" );
 	                jQuery( "table.listTable tbody tr:odd" ).addClass( "listAlternateRow" );
 	                jQuery( "table.listTable tbody tr:even" ).addClass( "listRow" );
-					setMessage( i18n_delete_success );
+					
+					var usersTable = $("table.listTable tbody");
+					usersTable.trigger("update");
+  
+					showWarningMessage( i18n_delete_success );
     	    	}
     	    	else if ( json.response == "error" )
-    	    	{
-    	    		showWarningMessage( json.message );
+    	    	{ 
+					showWarningMessage( json.message );
     	    	}
+				hideMessage();
     	    }
     	);
     }
 }
 
+
 /**
  * Create jQuery datepicker for input text with id * * 
  * @param id the id of input filed which you want enter date *