Add new class to the row
Add new class to the row
Hi Allan =)
I'm trying to improve the delete function to be more intuitive
Today it works this way:
- When I click the button (delete) this function is triggered
[code]
function confirma_delete(name, table) {
var answer = confirm("Remover linha " + name + "?"); // Do you want to remove the line?
if (answer) {
valor = "row_id=" + name + "&table=" + table;
newXmlRequest(valor,'./delete_ajax.php'); // delete_ajax.php is responsible for the rest
}
}
[/code]
The button
[code]
[/code]
But the deletion will only occur when I click on (Save Changes) it will be processed on the database.
I want to change the color of the line that was "confirmed to be deleted" to gradeX.
On the function confirma_delete how can I (implement a function to) add a new class (gradeX) to that row after the confirmation?
What parameters I must pass to do this?
Here is the live example
www.spro.com.br/fernando/editable.php
btw, datatables is completely awesome! and Visual Event too!
I'm trying to improve the delete function to be more intuitive
Today it works this way:
- When I click the button (delete) this function is triggered
[code]
function confirma_delete(name, table) {
var answer = confirm("Remover linha " + name + "?"); // Do you want to remove the line?
if (answer) {
valor = "row_id=" + name + "&table=" + table;
newXmlRequest(valor,'./delete_ajax.php'); // delete_ajax.php is responsible for the rest
}
}
[/code]
The button
[code]
[/code]
But the deletion will only occur when I click on (Save Changes) it will be processed on the database.
I want to change the color of the line that was "confirmed to be deleted" to gradeX.
On the function confirma_delete how can I (implement a function to) add a new class (gradeX) to that row after the confirmation?
What parameters I must pass to do this?
Here is the live example
www.spro.com.br/fernando/editable.php
btw, datatables is completely awesome! and Visual Event too!
This discussion has been closed.
Replies
[code]
function confirma_delete(name, table) {
var answer = confirm("Remover linha " + name + "?"); // Do you want to remove the line?
if (answer) {
valor = "row_id=" + name + "&table=" + table;
newXmlRequest(valor,'./delete_ajax.php'); // delete_ajax.php is responsible for the rest
$(this).parents('tr').addClass( 'gradeX' );
}
}
[/code]
That will find the TR parent of the button that was clicked on and add the gradeX class.
Thanks for the kind words :-)
Regards,
Allan