I want to create links in record fields in DataTables from JSON data

后端 未结 6 1900
深忆病人
深忆病人 2020-12-28 19:09

I\'m creating a dataTables table to use as an archive of pages for a site that produces a comic strip. On that archives page, I\'d like to have the title of the comic be a l

6条回答
  •  既然无缘
    2020-12-28 19:12

    you should use fnRowCallback option see documentation.

    $('#example').dataTable({
         "bProcessing": true,
         "bServerSide": true,
         "sAjaxSource": "archive/archive.txt",
         "fnRowCallback": function( nRow, aData, iDisplayIndex ) {
                $('td:eq(2)', nRow).html('' +
                    aData[2] + '');
                return nRow;
            },
    });
    

提交回复
热议问题