jQWidgets Forums
jQuery UI Widgets › Forums › Navigation › Tree › Search/Filter for jqxTree
This topic contains 4 replies, has 2 voices, and was last updated by Dimitar 11 years, 10 months ago.
-
Author
-
Hi
Is it possible to give a search/filter for jqxTree. I couldn’t find any documentation regarding this. If it not possible directly, is there any work around ? In my tree there may be more than 500 items. So users will ask for some search/filter. Looking for your reply.
Regards
Dominic
Hello Dominic,
Unfortunately, there is no such functionality in jqxTree.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi
Thank you for your reply.
I was trying to create a workaround. I was partially succeeded and it may not the best as i am not an expert in jquery. If i found an item which is at the bottom of the tree , how can i set the scroll bar to that position. The selection is in that item, but scroll bar is not moving based on the selection. Do you have any suggestions ?
If you have some around , please share.
var allItems; var list = new Array(); var itemselected = false; $("#txtsearch").keypress(function () { itemselected = false; if (allItems == null) { allItems = $('#jqxtree').jqxTree('getItems'); $.each(allItems, function () { list.push(this.value); }); searchitems(); } else { searchitems(); } }); function searchitems() { $.map(list, function (value) { if (itemselected == true) return; d = $('#txtsearch').val(); var search = new RegExp(d, "gi"); if (value.match(search)) { $.each(allItems, function () { if (itemselected == true) return; if (this.value.toUpperCase() == value.toUpperCase()) { $('#jqxtree').jqxTree('selectItem', this); $('#jqxtree').jqxTree('expandItem', this); itemselected = true; }; }); return value; } return null; }); }
Regards
DominicHi
Any updates on this ?
Regards
DominicHi Dominic,
There is no built-in method in jqxTree for scrolling to a particular item.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.