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

stanggt33stanggt33 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 / SSNDoctorNPIGroup / Individual
123456SMITH, BOBIndividual
654321Group
654321JONES, MIKEIndividual
654321JACKSON , JOHNIndividual

What Im trying to do:

EIN / SSNDoctorNPIGroup / Individual
123456SMITH, BOBIndividual
654321Group
JONES, MIKEIndividual
JACKSON , JOHNIndividual

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.