-
1. Re: execute js function on clicking tab?
BKBK Jan 31, 2012 11:37 AM (in response to ion)<div onclick="clearURL()">
<cflayout>
</cflayout>
</div>
-
2. Re: execute js function on clicking tab?
ion Jan 31, 2012 3:28 PM (in response to BKBK)thanks BKBK, but is not really working. is not the whole layout that needs to be affected, only one layoutarea.
when i do this, it throws the layout out of wack, and when clicked, it does nothing (no error either)
regards
-
3. Re: execute js function on clicking tab?
BKBK Feb 1, 2012 12:23 PM (in response to ion)ion wrote:
thanks BKBK, but is not really working. is not the whole layout that needs to be affected, only one layoutarea.
when i do this, it throws the layout out of wack, and when clicked, it does nothing (no error either)
I understand. You could place the DIV within the layoutarea, as in this example:
<script type="text/javascript">
f = function () {
alert('Karamba!')
}
</script>
<cflayout type="tab" name="tabLayout">
<cflayoutarea name="tab1" title="Tab 1">
Tab 1 contents
</cflayoutarea>
<cflayoutarea name="tab2" title="Tab 2">
<div onclick="f()" >
Tab 2 contents
</div>
</cflayoutarea>
</cflayout>
-
4. Re: execute js function on clicking tab?
ion Feb 17, 2012 10:14 AM (in response to BKBK)thanks BKBK, but it works only when clicking inside the tab, after it opens
regards
-
5. Re: execute js function on clicking tab?
AnotherPGriff Jun 21, 2012 4:45 PM (in response to ion)I used this to submit a form using ajax whenever a new tab is selected. This is essentially the onclick portion:
ColdFusion.Layout.onTabActivate = function(tab)<script type="text/javascript">
ColdFusion.Layout.onTabActivate = function(tab){
ColdFusion.Ajax.submitForm('myform', 'my.cfm')
}
</script>
<cfform id="myform" name="myform" action="my.cfm" method="post">
<cflayout type="tab" name="tabLayout">
<cflayoutarea name="tab1" title="Tab 1">
Tab 1 contents (form input)
</cflayoutarea>
<cflayoutarea name="tab2" title="Tab 2">
Tab 2 contents (form input)
</cflayoutarea>
</cflayout>
</form> -
6. Re: execute js function on clicking tab?
Steve Sommers Jun 21, 2012 5:30 PM (in response to ion)Maybe this will help: http://api.jquery.com/keypress/
-
7. Re: execute js function on clicking tab?
ion Jun 28, 2012 5:43 AM (in response to AnotherPGriff)Thanks AnotherPGriff, i'll give it a try
regards
-
8. Re: execute js function on clicking tab?
ion Jun 12, 2014 11:09 AM (in response to Steve Sommers)Thanks again AnotherPGriff, you pointed me in the right direction. My working code is:
ColdFusion.Layout.onTabActivate = function(tab){
myTabs = ColdFusion.Layout.getTabLayout("myLayout");
actTab = myTabs.getActiveTab();
if(actTab.id === "myRedirect") {
ColdFusion.navigate("redirectFile.cfm");
}
}
where actTab.id is actually the name attribute of my cflayoutarea
Regards


