Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

question about aui tabs

laurent January 25, 2021

Hi

I use AUI tabs to show 3 confiform tableview in 3 tabs. As describe in AUI.atlassian documentation there is on active (or main tab) and three other. MY pb is when I work in confiform table (table3 or 2 show in tab3 or 2) each time confiform refresh page it always return on First tab not on last tab used.

someone can help me to rest on current tab even if confiform refresh page after a new record ?

thx 

1 answer

1 accepted

0 votes
Answer accepted
Alex Medved _ConfiForms_
Community Champion
January 26, 2021

I believe you can tell what tab should be active, and that is by adding #tabname to the url

Which means you can probably set ConfiForms to redirect (via IFTTT rule, for example) on submit (create/modify) to the url you need

Alex

laurent January 30, 2021

Nop, it doesnt work. Even if I manually enter URL#tabname I have good URL in address bar but the page show always the the tab that was defined as active tab...

I think it s necessary to change active tab with js or jql but I don't know well scripts languages

Alex Medved _ConfiForms_
Community Champion
January 31, 2021

I am not a pro in Atlassian aui tabs and this is really not my cup of tea, but after a bit of a research I think that this little script could help

<script type="text/javascript"> 
AJS.toInit(function () {
initTabFor();

AJS.$(window).on('hashchange', function() {
initTabFor();
});
});

function initTabFor() {
var hash = AJS.$(window.location).attr('hash');
if (hash !== '') {
AJS.tabs.change(jQuery('a[href="' + hash + '"]'));
}
}
</script>

You will need to put it on your page - what it does is, it reads the anchor from the URL and tells the tabs to "switch" to this anchor

Obviously the anchor needs to be the same as the ID of a tab

The example is based on the https://aui.atlassian.com/aui/8.5/docs/tabs.html 

Hope it helps

Alex

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events