Need to change the label based on the row value in run time

Need to change the label based on the row value in run time

mahammad_smahammad_s Posts: 4Questions: 2Answers: 1

Need to add label for payment_type based on the condition if status "0" then "Cash" and for "1" - credit.

This question has an accepted answers - jump to answer

Answers

  • tangerinetangerine Posts: 3,350Questions: 37Answers: 394

    You need to provide a more detailed explanation.

  • mahammad_smahammad_s Posts: 4Questions: 2Answers: 1


    this is my table

    I want to change display name based on the condition if status "2" then "Cash" and for "1" - credit.

  • mahammad_smahammad_s Posts: 4Questions: 2Answers: 1
    Answer ✓

    i solved it by using render
    data:"usul",
    render:function ( data, type, row ) {
    var melumat = data;
    if((type === "display" || type === "filter") && melumat ==1){
    return 'Nəğd';
    }
    else if((type === "display" || type === "filter") && melumat ==2){
    return 'Kontur';
    }
    else{
    return data;
    }

                }
    
This discussion has been closed.