How to use the API $.fn.dataTable.render.ellipsis with a hyperlink
How to use the API $.fn.dataTable.render.ellipsis with a hyperlink
cj1005
Posts: 144Questions: 46Answers: 1
Hi,
On my backend server, I'm doing the following code to prepare my DT, both of the below options work, but I would like to use the ellipsis function in the first option instead of showing the full data. Is this possible, please?
IF !EMPTY(urllink)
cRender = [, render: function(data, type, row, meta) { return ( '<a href="]+atr(urllink)+[?key='+data+'" target="_blank">'+data+'</a>' ) }]
ELSE
cRender = [, render: $.fn.dataTable.render.ellipsis(20, true) ]
ENDIF
Something, like this:
IF !EMPTY(urllink)
cRender = [, render: function(data, type, row, meta) { return ( '<a href="]+atr(urllink)+[?key='+data+'" target="_blank">'+ $.fn.dataTable.render.ellipsis(20, true) +'</a>' ) }]
ELSE
cRender = [, render: $.fn.dataTable.render.ellipsis(20, true) ]
ENDIF
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
The Ellipsis renderer wouldn't support being used like that. You could hand-craft it by looking at the fifth example on
columns.render
,Colin
Thank you!