Create cell with hyperlink to "POST" data

Create cell with hyperlink to "POST" data

AblitterAblitter Posts: 13Questions: 5Answers: 0
edited April 2020 in Free community support

Hello everyone,
saw this old thread where an user explain how to create hyperlink in a cell
https://www.datatables.net/forums/discussion/25111/hyperlink-in-td

But what if i need to create an hyperlink withoud passing sensitive informations?
I would like to use the POST method using that link.

i have this function that return a link to the dataTable cell:

function createLink(baseURL, cname, id) {
  var link = document.createElement('a');
  link.href = baseURL + '?action=details&companyID=' + id + '&fromMain=false';
  link.appendChild(document.createTextNode(cname));
  return link.outerHTML;
}

What can be done to create a function that return a link to the cell and pass the sensitive informations using a POST method? Of course the link should point to the correct page the baseURL + the sensitive informations ('?action=details&companyID=' + id + '&fromMain=false')

Thank you in advance.

Answers

  • kthorngrenkthorngren Posts: 21,171Questions: 26Answers: 4,922

    You can use columns.render to render the HTML but the mechanism for sending a POST request is outside of Datatables. Maybe this SO thread will give you some ideas.

    Kevin

  • AblitterAblitter Posts: 13Questions: 5Answers: 0

    Thank you very much for the kind reply.

This discussion has been closed.