Hi, I am facing this problem: when a user open an internal link listed in a datatable and then he comes back to page containing the datatable (both using 'go back' or a link to the original datatable), filters and sorting that he chose before are lost, so he has to make his query again. To avoid this, I was thinking if there is a way to open the links listed in a datatable in a new tab. I read this, but seems to work just with wikitext. Any other ideas? Thanks, Lorenzo
Interesting question to which I do not have an answer. You might want to post to one of the mailing lists.
A possible solution comes to my mind now: Have a look at the "LinkTarget" extension that I think will be able to help you here since datatables has a class of it's own (srf-datatables
) you can work on.
I did some tests using the extension but with no success. I tried also this snippet source:
$( function () { $( '#mw-content-text' ).on( 'click', '.srf-datatables > a', function () { var otherWindow = window.open(); otherWindow.opener = null; otherWindow.location = this; return false; } ); } );
It seems to work better (using classes as attributes in <span>
); anyway using srf-datatables
(and also the newer smw-datatable
) nothing changes, links are always open in the same tab.
I don't know if I am doing something wrong or simply this cannot be achieved.
Thanks for your help anyway!
Lorenzo