This content has been marked as final.
Show 3 replies
-
1. Best way to load a html fragment in collapsible panel?
Arnout Kazemier Jul 31, 2008 7:34 AM (in response to jefbak)U can attach and onclick which will fire a function,
checks the parentsNode class name if it matches CollapsiblePanelOpen than u load the HTML data, else u do nothing :p
Something like
<div class= CollapsiblePanelOpen>
<div onclick="panelit(this)">title</div>
function panelit(ele){
var class = ele.parentNode.class;
if(class.match('CollapsiblePanelOpen'){
do html panel stuff.
}
} -
2. Best way to load a html fragment in collapsible panel?
jefbak Jul 31, 2008 8:25 AM (in response to Arnout Kazemier)Thanks for the quick response V1. I am trying to wrap my mind around your example, but having a little trouble. Here is what I did starting with the basic collapsible panel: Sorry for the a href's getting changed by the forum (is there a code tag?)
<div class="CollapsiblePanel" id="CollapsiblePanel1" >
<div class="CollapsiblePanelTab" tabindex="0">Fall 2008 Course Listing</div>
<div class="CollapsiblePanelContent">
</div>
</div>
and I want to load the content of this URL result:
http://catalog.smith.edu/results.php?term=200901&department=GOV&instructor=all& ;credits=all&course_number=&keyword=&attribute=
So going from the adobe lab panel sample
I tried this (which did not work):
<div class="CollapsiblePanel" id="CollapsiblePanel1">
<div class="CollapsiblePanelTab" tabindex="0"><a href="#" onclick="course.loadContent(' http://catalog.smith.edu/results.php?term=200901&department=GOV&instructor=all& ;credits=all&course_number=&keyword=&attribute=');">Fall 2008 Course Listing</a></div>
<div class="CollapsiblePanelContent">
<div id="courses">Course content</div>
</div>
</div>
and the script (appropriate css and js loaded):
<script type="text/javascript">
<!--
var CollapsiblePanel1 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel1", {contentIsOpen:false});
var course = new Spry.Widget.HTMLPanel("courses");
//-->
</script>
-
3. Best way to load a html fragment in collapsible panel?
Arnout Kazemier Aug 1, 2008 12:54 AM (in response to jefbak)Nope there is no code tag.. I have suggested it a while ago.. No clue why Adobe AIR prerelease forum had a attach code and Spry doesnt... but bleh.. nothing i can do about that :p
Anyways back to the subject..
Why wouldnt
<div class="CollapsiblePanel" id="CollapsiblePanel1">
<div class="CollapsiblePanelTab" tabindex="0"><a href="#" onclick="course.loadContent(' http://catalog.smith.edu/results.php?term=200901&department=GOV&instructor=all& ;credits=all&course_number=&keyword=&attribute=');">Fall 2008 Course Listing</a></div>
<div class="CollapsiblePanelContent">
<div id="courses">Course content</div>
</div>
</div>
work for u? Do u get an error? Do u have a live preview?
also did u try my suggestion?
<script>
function panelit(ele){
var class = ele.parentNode.className;
if(class.match('CollapsiblePanelOpen'){
course.loadContent(' http://catalog.smith.edu/results.php?term=200901&department=GOV&instructor=all& ;credits=all&course_number=&keyword=&attribute=')
}
}
</script>
<div class="CollapsiblePanel" id="CollapsiblePanel1">
<div class="CollapsiblePanelTab" tabindex="0"><a href="#" onclick="panelit(this); return false;">Fall 2008 Course Listing</a></div>
<div class="CollapsiblePanelContent">
<div id="courses">Course content</div>
</div>
</div>
(didnt test the code, but it should work)
(changed parentNode.class to parentNode.className)


