How do I render a cells value based on a value from the previous row
How do I render a cells value based on a value from the previous row
stanggt33
Posts: 5Questions: 2Answers: 0
Hello again,
I'm trying to render a cell value or even style based on the previous rows value for the same cell. Ive played around with it a bunch and can't seem to get it.
Basically if the first columns value is the same as the previous row, I want it to to be blank, otherwise give me the value.
Here is what I am getting as a result....followed by what I want
AS is
EIN / SSN | Doctor | NPI | Group / Individual |
---|---|---|---|
123456 | SMITH, BOB | Individual | |
654321 | Group | ||
654321 | JONES, MIKE | Individual | |
654321 | JACKSON , JOHN | Individual |
What Im trying to do:
EIN / SSN | Doctor | NPI | Group / Individual |
---|---|---|---|
123456 | SMITH, BOB | Individual | |
654321 | Group | ||
JONES, MIKE | Individual | ||
JACKSON , JOHN | Individual |
Here is my current code
function LoadNpiDataTable(route : string) {
$('#NpiTable').DataTable({
"ajax": route,
"destroy": true,
"columns": [
{ "title": "EIN / SSN", data: function (data) { return "<a class='editNpiLink' data-id=" + data.TaxId + " data-docId=" + data.DocId + " >" + data.TaxId + "</a>" } },
{ "title": "Doctor", "data": "Name" },
{ "title": "NPI", "data": "Npi" },
{
"title": "Group / Individual", data: function (data) {
if (data.Type == 1) {
return "Individual"
}
else return "Group"
}
}
]
});
}
Thanks in advance, any help is greatly appreciated
This discussion has been closed.