Update Cell value (html)
Update Cell value (html)
As in the attached image i need to update the cell (without refreshing table) when clicked on star when data == "false",
I am applying a custom function ApplyFavourite to perform the action
var custno = full.Customerno;
if (data == "true") {
return "<span class='glyphicon glyphicon-star' style='color :#FFFF00 ;text-shadow: -2px 0 #aeae1b, 0 -2px #aeae1b, 2px 0 #aeae1b, 0 2px #aeae1b;font-size:15px;'></span>";
}
else {
return '<a onclick=\'angular.element(this).scope().ApplyFavourite("' + custno + '","' + 1 + '")\' class="clslink"><span class="glyphicon glyphicon-star-empty" title="Click to mark as favourite" style="font-size:13px;"></span></a>';
}
How do i get the specific cell value in this case, and then update the cell , so the cell will be seen with a yellow star i.e it is updated as favourite.
Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This discussion has been closed.
Answers
Use
cell().data()to update a cell's data. That same method can also be used to get the cell's current data.Allan
But how will i get the Cell.data() in ApplyFavourite() function.
Below is how my column rendered.
Do you want the rendered data, or the unrendered data? If the rendered data use
cell().render(). For the unrendered data usecell().data().Allan