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.
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 EngineerInfragistics, Inc.www.infragistics.com
Thanks Mike, that worked perfectly!
One more question I have on the WebExplorerBar - is there something related to this component that always positions the page back to the top? We have maintainScrollPositionOnPostBack="true" but on this page it always jumps back to the top of the page everytime a menu item on the webexplorerbar is clicked, which makes the screen appear to be jumping around as they get to the lower menu items.
this works but if I have only one group and I try to collapse after expanding then it again jumps to the top..Any way to prevent this?
Hello frce,
I am following up to see if the information provided has resolved this matter.
Please let me know if I may be of further assistance with this matter.
For your WebExplorerBar do you have ExplorerBarAutoPostBackFlags set for the ItemClick or ItemSelected? If so what is this set to On, Off or Async? I believe what is occurring is you have an AutoPostBackFlag set to On which causes a full page postback, if you set this to Async it should eliminate the paging from jumping to the top. Please see the following link for more information concerning this matter.
http://help.infragistics.com/NetAdvantage/ASPNET/2011.2/CLR4.0/?page=Infragistics4.Web.v11.2~Infragistics.Web.UI.AutoPostBackFlag.html