How add id row to all columns

How add id row to all columns

MixoMixo Posts: 1Questions: 1Answers: 0

Hi, I'm trying to add the id key to all the columns, but the following function (that generate the link) doesn't create it
It returns: mypage/undefined
Is it possible generate it?
Thank's

    {
        targets:  "_all" ,
        render: function ( data, type, row, meta ) {

            if(type === 'display'){

                data = '<a href="/mypage/' + data.id + '">' + data + '</a>';
            }

            return data;
        }
    }

Answers

  • bindridbindrid Posts: 654Questions: 0Answers: 103

    Try data, not data.id. The first argument should be the single data point for that cell.

  • adareedadareed Posts: 1Questions: 0Answers: 0

    I grateful for this post. I’ve been trying everywhere for this! Impart goodness I found it on this post. I really esteem your work and that I expect in future I’ll come back for additional data. Like this one. Some points described here were new for me and it was really wonderful to go through such informative post. You have created my day! Thanks again! I actually have some sensible work expertise with write my essay and my words are clearly supported what I felt through such processes within the past.

Sign In or Register to comment.