Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a very simple setup, a grid called #list with a datasource populated with records to display.

I have a button on each row with an onClick event that calls this function:

JavaScript
// Soft-Delete person
    var processURL = crudServiceBaseUrl + '?method=deletePerson';
    function deletePerson(id){
    	if (confirm('#getResource("person.detail.confirmdel")#')) {
    		$.ajax({
    			type: 'POST',
    			url: processURL,
    			data: {
    				PERS_KY: id
    			},
    			success: function (data){
    				var thingToDelete = "tr:eq("+id+")";
    				var grid = $("#list").data("kendoGrid");
    				grid.removeRow(thingToDelete);
    			},
    			error: function (xhr, textStatus, errorThrown){
    				alert("Error while deleting person"+ "\n"+ xhr + "\n"+ textStatus + "\n" + errorThrown);
    			}
    		});
    	}
    }


The server-side stuff works fine, the interaction with the database is good. However, the row does not disappear from the grid.

Anyone?
Posted
Comments
sagivasan 2-Jul-15 8:01am    
var thingToDelete = document.getElementById(id);
thingToDelete.removeRow(thingToDelete);

if this not working , post html code(table part with sample list)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900