How to replace Fail value with X?

How to replace Fail value with X?

ColdFlowColdFlow Posts: 6Questions: 3Answers: 0

I have this data table that will display the status of an inspection to display pass or fail. So far I have my code set up where if the inspection is 'pass' it will display ✔ and if it is 'fail' it will display X.

The problem I am having now is that if it is 'pass' or 'fail' it will display ✔. How can I rewrite my code to where it will display X?

Below is my code:

            columns: [
                { data: "datetime" },
                { data: "forklift" },
                { data: "driver" },
                { data: "shift"},
                { data: "inspection"},
                { data: "status",
                    render: function(data,type){
                        if (type === 'display'){
                            if(data = 'pass'){
                                return "✔";
                            } else if (data = 'fail'){
                                return "X";
                            }
                            return data;
                        }   
                        return data;
                    }
                },
                { data: "completed"},
            ],

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954
    Answer ✓

    I answered your question in your other thread. Please don't post duplicate questions.

    Kevin

This discussion has been closed.