I created extra tabs on a list page with the WHERE Tabs API (tabs based on records in table), this works perfect.
WhereTabs::DeleteTab($table,"");
$mybutton = "<button type='button' id='tabbutton".$i."' class='btn btn-outline-primary' style='color: black; background-color:".$gdata["Color"]."'>"
.$gdata["Name"]."<span class='badge' style='margin-left: 10px';>".$draftcount."/".$totalcount."</span></button>";
WhereTabs::addTab($table,"TargetGroup='".$gdata["Id"]."'", $mybutton, "grouptab".$i);
The first tab (All data) which is created automatically in design time is deleted.
When you open the page, no tab is active and all data is shown.
Solved that by putting the following in the OnPageLoad event:
var ActiveTABID = $('li[class=active]').find('a[data-tabid]').attr('data-tabid');
if (!ActiveTABID){
$('button[id=tabbutton1]').click();
}
The question: is there a better way to set one of the tabs to 'active', preferrably from URL (without first loading all data and then simulating the 'click' event)?
Thanks
J.