Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
945
Added a template to ExplorerBarGroup. Have questions
posted

Hi,

I figured out how to add templates to the ExplorerBarGroup. I added a couple simple buttons using the following code:

<ig:ItemTemplate runat="server" TemplateID="test">
<template>
<table><tr><td><input type="button" value="Test 1" /></td><td><input type="button" value="Test 2" /></td><td><input type="button" value="Test 3" /></td></tr></table>
</template>
</ig:ItemTemplate>

 Now every time i click on any of the buttons, the WebExplorerBar keeps doing an expand/collapse as if i'm clicking on the header its self. How do i change it so that if i click on the buttons, the expand/collapse will stay as is until i click on the actual header space?

Parents
No Data
Reply
  • 49378
    posted

    Hi Shane,

    Thank you for posting in the community.

    In order to not expand/collapse the WebExplorerBar groups when a templated control is being clicked I suggest handling ItemExpanding and ItemCollapsing clientside event which may be cancelled if the target of the event is a button for instance. Below is some sample code for such an implementation:

    Code Snippet
    1.  
    2. function WebExplorerBar1_ItemCollapsing(sender, eventArgs)
    3. {
    4.     if (eventArgs.get_browserEvent().target.type == "button") {
    5.         eventArgs.set_cancel(true);
    6.     }
    7. }
    8.  
    9.  
    10. function WebExplorerBar1_ItemExpanding(sender, eventArgs)
    11. {
    12.     if (eventArgs.get_browserEvent().target.type == "button") {
    13.         eventArgs.set_cancel(true);
    14.     }
    15. }

    Please let me know if this helps.

Children
No Data