delete single row
delete single row
kortex
Posts: 5Questions: 0Answers: 0
This is the relevant PHP:
[code]$sOutput .= '" Delete ",'; [/code]
This results in output of:
[code]Delete [/code]
What I would like to do is remove that row from the list, and then write a message above the table to the effect of "You have successfully removed this item."
jQuery I wrote is not working:
[code]$('a.deleteRow').click(function() {
$(this).parents('tr').remove();
});[/code]
actually there is no reaction for click.
I have tried this one also no reaction too.
[code]$('a.deleteRow').click(function() {
alert("wait...");
});[/code]
Anyone have some advice? where is Problem?
[code]$sOutput .= '" Delete ",'; [/code]
This results in output of:
[code]Delete [/code]
What I would like to do is remove that row from the list, and then write a message above the table to the effect of "You have successfully removed this item."
jQuery I wrote is not working:
[code]$('a.deleteRow').click(function() {
$(this).parents('tr').remove();
});[/code]
actually there is no reaction for click.
I have tried this one also no reaction too.
[code]$('a.deleteRow').click(function() {
alert("wait...");
});[/code]
Anyone have some advice? where is Problem?
This discussion has been closed.
Replies
when i click to delete link, still no reaction..
[code]
$(document).ready(function() {
$('#datatable').dataTable({
"bProcessing": true,
"bServerSide": true,
"sPaginationType": "full_numbers",
"sAjaxSource": "includes/list.php",
"sServerMethod": "POST"
});
$('a.deleteRow').click(function() {
alert("wait...");
});
});
[/code]
If you want to delete the row, you need to delete it at the server and then call fnDraw. Reason being, you are using server-side processing - so the data is at the server.
Allan
but click function does not respond
when i click delete link nothing happens, should give an alert but there is no alert..
sorry for my english :(
js like this:
[code] $(document).ready(function() {
$('#datatable').dataTable({
"bProcessing": true,
"bServerSide": true,
"sPaginationType": "full_numbers",
"sAjaxSource": "includes/list.php",
"sServerMethod": "POST"
});
$('.deleteRow').click(function() {
alert("wait...");
});
});
[/code]
output like this:
[code]
lorem ipsum
lorem ipsum
lorem ipsum
lorem ipsum
1
delete
[/code]
when i click delete no alert..
but when i put this delete link in my page manuelly (not php output) function working good..
here is solution: http://stackoverflow.com/questions/17087881/click-function-in-datatables-action-menu
I worked two days and look at the answer :))