jQuery UI Widgets › Forums › Navigation › Tree › 'ensureVisible' is not setting visible element
This topic contains 5 replies, has 2 voices, and was last updated by Hristo 8 years, 11 months ago.
-
Author
-
Hi,
Any reasons can be for tree not set ensureVisible for element. The tree locatated inside the tabs control. And all I am doing is selecting specific element on tree when switching to that tab and want it to be scrolled to. Its all working fine and element selected but not scrolled to.
I have this code on both tabs switch and tree initialized. Please advise.$('#jqxTreeHistory').on('initialized', function (event) { getMobileLocationsToUpdateHistoryTree(); if (selectedUserID > 0) { var allusersItems = $('#jqxTreeHistory').jqxTree('getItems'); if (allusersItems != null) { $.each(allusersItems, function () { if (this.hasItems == false) { if (this.value == selectedUserID) { selectedUserID = 0; $('#jqxTreeHistory').jqxTree('expandItem', this.element); $('#jqxTreeHistory').jqxTree('ensureVisible', this.element); $('#jqxTreeHistory').jqxTree('selectItem', this.element); return false; }; } }); } } });
Hello Marina,
Please, take a look this example:
http://jsfiddle.net/txhi/49oxymtp/Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.commaybe difference when tree inside of tab. In my case it got selected fine with right id of item, but never scrolled to. Could it be some effect of bubble event or anything?
I modified your example in jsfiddle and put tree inside of the tabs and then it stopped scroll to element, though element got selected still fine.
<div id='jqxTabs' > <ul> <li>Tab1</li> <li>Tab2</li> </ul> <div id="content1" style="overflow: hidden;"> content1 </div> <div id="content2" style="overflow: hidden;"> content2 <div id='jqxTreeHistory' ></div> </div> </div>
init tab
$("#jqxTabs").jqxTabs({ width: 300, height: 500, initTabContent: initTabs });
Hello Marina,
Need to get right sequences. After you write initialization for each widgets then create jqxTab.
Please, take a look this example:
http://jsfiddle.net/txhi/fm0g7z1e/Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.