How can i empty and append a new value in column?
How can i empty and append a new value in column?
When i click in the action, i want change de color of status.
With this command $row.prevObject[0].parentElement.parentElement.cells[8] i can see the span, but i don´t know how remove this and put another with other color.
I tried this, but doensin´t work...
$row.prevObject[0].parentElement.parentElement.cells[8].closest('td').append('<span data-toggle="tooltip" title="Rejected." style="height: 15px;width: 15px;background-color: red;border-radius: 50%;display: inline-block;"></span>')
Answers
Inspect the element to find the selector to use. Since you are creating custom buttons we will need to see a running test case to see what you have to offer suggestions.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
@kthorngren
Likje, qhen i click de botton change de color.
http://live.datatables.net/rubezevo/6/edit
I would add a classname to the
span
and create a delegated event as shown in this example. See this updated example:http://live.datatables.net/rubezevo/7/edit
Kevin
@kthorngren ,
Sorry to be bothering you.
But is it possible to change the color by clicking the action button and not the circle?
Change the click event handler to the button then use standard Javascript or jQuery methods to get the get the sibling
td
with the -tag span` you want to change the color.Kevin