Render to insert the link

Render to insert the link

klermannklermann Posts: 277Questions: 67Answers: 1

Hello! How do I solve this? I can not get the attribute of the objects without it being this etiquetas[0].nome, it happens that when I try to render to insert the link in that item, it returns me indefined?


ec2-54-157-236-83.compute-1.amazonaws.com:8080/financeiro/receitas

Answers

  • allanallan Posts: 52,525Questions: 1Answers: 8,020 Site admin

    Use:

    data: 'etiquetas',
    render: function ( data, type, row ) {
      var out = '';
      if ( data && data.length ) {
        for ( var i=0, ien=data.length ; i<ien ; i++ ) {
          out += '<a ....>'+data[i].nome+'</a>;
        }  
      }
      return out;
    }
    

    Allan

  • klermannklermann Posts: 277Questions: 67Answers: 1

    Thanks Allan, for not knowing the framework thoroughly, I did not imagine it could be this way!

This discussion has been closed.