Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have a partly working solution now.</p> <p>I followed Ian's suggestion and looked through the toolkit source. In <code>CollapsiblePanelBehavior.debug.js</code>, you can that <code>expandPanel()</code> is apparently intended as part of the public interface for the behavior. There's also a <code>get_Collapsed()</code>. The key to accessing these behaviors in javascript seems to be setting the <code>BehaviorID</code> property on your <code>CollapsiblePanelExtender</code> tags in ASP.NET.</p> <p>I modified the repeater on my page so that the <code>BehaviorID</code>s are predictible, along these lines:</p> <pre class="lang-html prettyprint-override"><code>&lt;ajaxToolkit:CollapsiblePanelExtender BehaviorID="&lt;%#'collapsebehavior'+DataBinder.Eval(Container.DataItem,'id')%&gt;" ID="CollapsiblePanelExtender" runat="server" /&gt; </code></pre> <p>This results with behaviors named <code>collapsebehavior1</code>, <code>collapsebehavior2</code>, <code>collapsebehavior3</code>, etc..</p> <p>With this done, I'm able to expand all the collapsible panels on the client as follows:</p> <pre class="lang-javascript prettyprint-override"><code>function expandAll() { var i = 0; while (true) { i++; var name = 'collapsebehavior' + i; var theBehavior = $find(name); if (theBehavior) { var isCollapsed = theBehavior.get_Collapsed(); if (isCollapsed) { theBehavior.expandPanel(); } } else { // No more more panels to examine break; } } } </code></pre> <p>I'm sure using <code>$find</code> in a loop like that is really inefficient, but that's what I have so far.</p> <p>Also, it doesn't work on Firefox for some reason. (On FF only the first element expands, and then there's a Javascript error inside the Control Toolkit code.)</p> <p>This will all seem extremely ugly to all you javascript pros. Maybe I'll clean things up later, or you can help me out.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload