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
40
WebExplorerBar - collapse groups in java script
posted

Whenever the user clicks on one of the group items on the WebExplorerBar, I could like to collapse any existing open groups on the client side using java script.  Can anyone provide an example of how to do this on the Item Expanded event? I need code to get all open groups (other than one that was clicked) and collapse them.

Thanks in advance for any suggestions.

Parents
  • 25665
    Verified Answer
    Offline posted

    Hello Charles,

    This is possible by looping through the groups in your WebExplorerBar and setting their expanded state. The following code demonstrates how you can achieve this in the client side ItemExpanded event. Please note that for this method to work properly each group should have a unique value.


    var count = sender.getExplorerBarItems().get_length();
        var newExpandItem = eventArgs.getExplorerBarItem();
        for (var i = 0; i < count; i++) {
            var item = sender.getExplorerBarItems().getItem(i);
            if (item.get_value() != newExpandItem.get_value()) {
                item.set_expanded(false);
            }
        }

    Please let me know if you have any questions concerning this matter.

    Sincerely,
    Mike P.
    Developer Support Engineer
    Infragistics, Inc.
    www.infragistics.com

Reply Children