3

I've got Hillbilly Tabs working great in my on-prem 2013 environment. The only issue I'm running into is with selecting items or documents in the web parts when they are inside tabs. This seems to be a known bug and I wanted to see if the StackExchange community had any insight.

The normal functionality in a web part allows a user to select many items at random and then perform an operation from the ribbon, like delete or check-in. When the web parts are inside tabs, the functionality is buggy. For example, I select 2 items and then when the 3rd item is selected, the other 2 are arbitrarily deselected. Very strange behavior. Has anyone else run into this and found a fix?

I also tried using App Parts instead of web parts and different page layouts, all with the same result. When I remove them from tabs, they function as expected and I can select any number of items without any others deselecting. Select all items works in all cases. I've tried 3 different versions of JQuery, with and without JQueryUI, and custom themed JQuery UI, all with the same bugginess.

On the Author's website, someone asked the same question.

Prabha Poulose on December 17, 2015 at 3:39 pm said:

Hello Mrackley, We are using the Hillbilly tabs on our SP2013 pages and it is very nice. The only thing we found is not able to do multiple selections of items on the web parts within the tabs. If I select more than two items, all items get deselected and only the last clicked item will be selected.

I was searching the if there is any workaround for this and didn’t find any solution. Will you be able to shed some light on these issue.

And the response.

mrackley on December 17, 2015 at 3:42 pm said:

this is a known limitation of the solution, I have not had the time to determine if a workaround is possible.

Any suggestions or advice is much appreciated!

1

From the look of it's not an easy fix, I have not used that script before, but a quick test shows it's a problem with the ribbon. Probably losing some context at some point. And what it does then is to call the DeselectAllWPItems function.

Tbh SP.Ribbon.js is way to complicated to worth trying to override for this script. Probably best to write a better script for managing tabs for webparts.

A poor half fix could be to override the DeselectAllWPItems function, still it wont work 100%, the Ribbon context will swith on and off, you'll notice you lose the List/Library tabs.

<script type="text/javascript">
     jQuery(document).ready(function($) { 
        HillbillyTabs();
        SP.SOD.executeOrDelayUntilScriptLoaded(function() {
            window.DeselectAllWPItems = function() {};
        }, 'sp.ribbon.js');

    });
</script>
  • I implemented your suggestion and it works exactly as described with the ribbon tabs seemingly toggling on and off. I noticed that this was a problem before though, so it's not a side effect of your "half fix", but just another bug with HillbillyTabs. – AtariPixel Apr 8 '16 at 14:56
  • @AtariPixel yeah, thats the issue causing it to deselect. I'm guessing the changes to the DOM has something to do with it, that the ribbon uses some data attributes on the DOM elements or something. I haven't looked at the selectors etc used (if any) in SP.Ribbon.js , but if it has some parent selectors etc it could hit the new DOM elements added maybe. – Anders Aune Apr 8 '16 at 20:19
  • I find that when I click and hold a select box, then move the mouse away before releasing, the ribbon tabs are toggled but the item is not selected. I'm assuming this corresponds to the onClick or onFocus attribute somewhere? – AtariPixel Apr 12 '16 at 7:34
  • You are probably right about that, I haven't had time to take a deeper look at it yet. Kinda cool idea to just make tabs without much work – Anders Aune Apr 18 '16 at 8:54
0

I have used it in one of my project & it is working like a charm with 3 listview WebParts in each tab.

Please check this link if you failed to follow any of the step from this.

  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review – Paul Strupeikis Apr 8 '16 at 11:07
  • You are right Paul. i will take care of this. – Hardik Apr 8 '16 at 11:11
  • This looks like an earlier version being used. Nevertheless, I did try the setTimeout delay, but even with 5000ms, the problem with select boxes is still present. I'm noticing that Calendar web part layouts are jumbled up as well, but again, the delay doesn't seem to affect this. – AtariPixel Apr 8 '16 at 11:49
0

Replace this code in Hillbilly Tabs,

$("#tabsContainer").attr("id",tabDivID).append("<ul id='"+ulID+"'></ul>");

to below.

var parentObj = $("#tabsContainer").closest("[id^='MSOZoneCell_WebPart']").parent(); parentObj.attr("id",tabDivID); parentObj.prepend("<ul id='"+ulID+"'></ul>"); $("#tabsContainer").attr("id",tabDivID).append("<ul id='"+ulID+"dummy'></ul>");

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.