render info icon

render info icon

wuwuwuwu Posts: 52Questions: 17Answers: 0

Hi, may i know how to render a button if the field has existing value otherwise do not render button using datatable server side processing? thanks

This question has an accepted answers - jump to answer

Answers

  • wuwuwuwu Posts: 52Questions: 17Answers: 0

    meaning display a button depending on the value of the field. i am using server side processing. thanks

  • Alexandr45Alexandr45 Posts: 30Questions: 1Answers: 3
    edited April 2020 Answer ✓
    {
                    data: null,
                    render: function ( data, type, row ) {
                        var  uchetkarta;
                       if(data.krim_issl.vivod == 1 && data.krim_issl.vid_krim == 1 ){
                          uchetkarta = '<a href=""><img src="../images/slruk.png" width="37"  alt=""/></a>';
                       } else if (data.krim_issl.vivod == 1 && data.krim_issl.vid_krim == 2){
                          uchetkarta = '<a href=""><img src="../images/slobuv.png" width="37"  alt=""/></a>';
                       } else {
                           uchetkarta = '';
                        }
                       
                        return uchetkarta;
                    }
                 }
    

    Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

  • wuwuwuwu Posts: 52Questions: 17Answers: 0

    Thanks much Alex and Colin, I just update the if (data.krim.....) to if (row.myfieldname.....)

This discussion has been closed.