CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 how to select default tab in Tabbed View

Print topic Send  topic

Author Message
boolean

Posts: 62
Posted: 08/31/2015, 5:45 AM

Hello,
Would someone please show me how to change the default tab of Tabbed View? I have my code below, and I would like to set the Panel1_2 to be the first one to be shown.

Thanks a bunch.

<!DOCTYPE HTML>
<html>
<head>
<meta name="GENERATOR" content="CodeCharge Studio 5.1.1.18990">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>TabbedView</title>
<link rel="stylesheet" type="text/css" href="../Styles/{CCS_Style}/Style_doctype.css">
<link rel="stylesheet" type="text/css" href="../Styles/{CCS_Style}/jquery-ui.css">
<script language="JavaScript" type="text/javascript">
//Begin CCS script
//Include Common JSFunctions @1-6ADB6CED
</script>
<script src="../ClientI18N.php?file=Globalize.js&locale={res:CCS_LocaleID}" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
//End Include Common JSFunctions

//Include User Scripts @1-B6BEBCCB
</script>
<link rel="stylesheet" type="text/css" href="../Styles/{CCS_Style}/jquery-ui.css">
{page:scriptIncludes}
<script type="text/javascript">
//End Include User Scripts

//Common Script Start @1-8BFA436B
jQuery(function ($) {
var features = { };
var actions = { };
var params = { };
//End Common Script Start

//Controls Selecting @1-12401E03
$('body').ccsBind(function() {
features["Panel1Panel1_1TabbedTab1"] = $('*:ccsControl(Panel1, Panel1_1)');
features["Panel1Panel1_2TabbedTab2"] = $('*:ccsControl(Panel1, Panel1_2)');
features["Panel1Panel1_3TabbedTab3"] = $('*:ccsControl(Panel1, Panel1_3)');
features["Panel1TabbedView1"] = $('*:ccsControl(Panel1)');
});
//End Controls Selecting

//Feature Parameters @1-343EC3D0
params["Panel1TabbedView1"] = {
tabs: [
{ selector: '*:ccsControl(Panel1, Panel1_1)', caption: "Panel1_1" },
{ selector: '*:ccsControl(Panel1, Panel1_2)', caption: "Panel1_2" },
{ selector: '*:ccsControl(Panel1, Panel1_3)', caption: "Panel1_3" }
]
};
//End Feature Parameters

//Feature Init @1-AA35CB7A
features["Panel1TabbedView1"].ccsBind(function() {
this.ccsTabs(params["Panel1TabbedView1"]);
});
//End Feature Init

//Common Script End @1-562554DE
});
//End Common Script End

//End CCS script
</script>
</head>
<body>
<!-- BEGIN Panel Panel1 -->

<!-- BEGIN Panel Panel1_1 -->1_1<!-- END Panel Panel1_1 -->

<!-- BEGIN Panel Panel1_2 -->1_2<!-- END Panel Panel1_2 -->

<!-- BEGIN Panel Panel1_3 -->1_3<!-- END Panel Panel1_3 -->

<!-- END Panel Panel1 -->
</body>
</html>
View profile  Send private message
zagor_chiavarino

Posts: 11
Posted: 09/08/2015, 2:50 AM

//Custom Code @157-2A29BDB7
#raggiunge il pannello di destinazione
global $Redirect;
$Redirect = "http://www.pippo.it."."#Panel1Panel3";
//End Custom Code
View profile  Send private message
jmwangi

Posts: 3
Posted: 09/09/2015, 2:37 AM

Just try this....

Bring the tab 2 first like below

//Feature Parameters @1-343EC3D0
params["Panel1TabbedView1"] = {
tabs: [
{ selector: '*:ccsControl(Panel1, Panel1_2)', caption: "Panel1_2" },
{ selector: '*:ccsControl(Panel1, Panel1_1)', caption: "Panel1_1" },
{ selector: '*:ccsControl(Panel1, Panel1_3)', caption: "Panel1_3" }
]
};
Let me Know
View profile  Send private message
boolean

Posts: 62
Posted: 09/11/2015, 2:26 PM

Hi Zagor,
It does not work: I get the error page "This page can’t be displayed".

Hi Jmwangi,
It is very nice try. It changes the position of Panel1_2 to be the first one on the left. However, I would like to keep it position Panel1_2 be the second but we want to see it first while its tab is still the second.

Thank you. If you can come up with something, please let me know.
View profile  Send private message
jmwangi

Posts: 3
Posted: 09/15/2015, 4:39 AM

$("a[id^='Panel1casescase_number']").click(function(event) {

var $mytabs = $("#Panel1Panel2").tabs();
$mytabs.tabs('option','active',0);
return false;

});

This click event works for me where you need change to a particular tab based on a click event. May be you can attach this to an onload event

May be

$(document).ready(function() {
var $mytabs = $("#Panel1").tabs();
$mytabs.tabs('option','active',1);
return false;
});
Or

$(window).load(function($) {
var $mytabs = $("#Panel1").tabs();
$mytabs.tabs('option','active',1);
return false;
});

Have not tried this onload event but i guess should work ...vary the panel number(may be 1 for your case)....Let me Know
View profile  Send private message
MaFi

Posts: 49
Posted: 09/17/2015, 9:23 AM

Hi,
I am not shure how the tabs in CCS are working, but if it is jquery-ui the following should work:

after loading the tabs insert:

var index=$('#your_tabs ul li').index($("#{atab}"));
$("#your_tabs").tabs({ active: index });

{atab} = label for id of the activ tab (eg. asigned by url parameter)

In HTML every tab <li> should have an unique id, eg:
<li id="tab1">your tab content</li>
<li id="tab2">your tab content</li>
<li id="tab3">your tab content</li>

Maybe you have to modify this for the CCS tabs.

Regards

Martin
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.