Render html element
Render html element
BJW86
Posts: 30Questions: 11Answers: 0
Is there a way I can render an element of the linked page in this dropdown row? I have been playing around with data render options but I can't figure it out?
Thanks,
Bruce
Answers
Are you using Child Row Details or the Responsive extension?
Please provide a link to your page or a test case replicating the issue so we can see what you are doing to offer suggestions.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Hi Kevin,
Thanks for your message, here is the test case:
http://live.datatables.net/jehageza/1/edit
I am trying to pull the main text for the linked article into the child row, I been tried using render options in the columns section but Ive not been able to get it to work.
Do you know if that would be possible? and what would be the best way to get it to work?
Thanks,
Bruce
If you want it to be a hyper link you need to place it in an HTML
a
tag, like this:http://live.datatables.net/jehageza/2/edit
Kevin
Thanks Kevin, not quite what I was trying to do but not a bad option.
Thanks,
Bruce
Do you mean you want to make a request to get the content of the target link and then show it in the table?
I suspect you'd need to use a proxy at the server-side to make that request and then parse and strip the data from it. I'd be surprised if Newspapers such as the Morning Star and the like would allow an Ajax request to get their content (which they can block with CORS headers). And even if they currently did, you would be a single config option away on their side from that approach being blocked.
You could Ajax load the child details so you wouldn't need to request and parse all the data upfront - only when requested.
Regards,
Allan