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
110
IsExplorerBarGroup
posted

I have what should be a simple thing, but doesnt seem to be working. Please tell me what I am missing. thanks.

My javascript testing code on the page:

    function WebExplorerBar_ItemSelected(sender, e) {
        alert('selected');
        alert(e.IsExplorerBarGroup());
        var selItem = e.NewSelectedItem();
        alert(selItem.get_text());
    }

The error message I get.

Line: 137
Character: 9
Code: 0
Error Message: Object doesn't support this property or method

line 137 character 9 is the IsExplorerBarGroup() method I found in the documentation at:
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2010.1/CLR3.5/html/Infragistics35.Web.v10.1~Infragistics.Web.UI.NavigationControls.ExplorerBarItemSelectedEventArgs

Public Methods
  Name Description
 IsExplorerBarGroup Check whether the ExplorerBarItemBase is ExplorerBarGroup (Inherited from ExplorerBarItemBaseEventArgs)
 IsExplorerBarItem Check whether the ExplorerBarItemBase is ExplorerBarItem (Inherited from ExplorerBarItemBaseEventArgs)

I do have a script manager on the form as well as the WebExplorerBar. I get the alert box for the 'Selected' but then it errors.

Thanks,

Mike

 

  • 3726
    Suggested Answer
    posted

    Hi Mike,

    This property is present only on the server side in the proper event args class. The ItemSelected client side event returns an ExplorerBarItemSelectedEventArgs object for "e". You can obtain the new selected item with e.getNewSelectedItem() which will return an ExplorerBarItem object and then on the client side you can write your own method like:

    function isExplorerBarGroup(explorerBarItem)

    {

         return !explorerBarItem.get_parentItem(); // returns null when the item is group, because it does not have parent items.

    }

    Thanks,

    Lubomir