Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: search mechanism,
naqvia
Member

Posts: 13
Registered: 4/12/2007
Location: USA
Member Is Offline
posted on 5/14/2007 at 09:48 PM Reply With Quote
search mechanism,


Hi,

How would one go about adding search capability to the tree. Where and what code needs to be changed,and how will one call it?

-Ammar
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 5/14/2007 at 09:52 PM Reply With Quote

In Tigra Tree Menu PRO search functionality is already available via the API. In free version you can implement it on top of the existing script by looping through .a_index array and looking at each tree item.

here are the fragments of the Tigra Tree Menu PRO that provide the search functionality (may need adjustments for free version):

Code:

// find item by caption/link method
this.find_item = function (s_value, b_link) {
var a_items = [];
b_link = b_link?1:0;
for (var i = 0; i < this.a_index.length; i++)
if (this.a_index.a_config[b_link] == s_value) {
a_items[a_items.length] = this.a_index;
}
return a_items;
};
this.find_item_by_key = function (s_key, s_value) {
var a_items = [];
for (var i = 0; i < this.a_index.length; i++)
if (this.a_index.a_config[2][s_key] == s_value) {
a_items[a_items.length] = this.a_index;
}
return a_items;
};
this.find_item_by_state = function (n_mask) {
var a_items = [];
for (var i = 0; i < this.a_index.length; i++)
if (this.a_index.n_state & n_mask) {
a_items[a_items.length] = this.a_index;
}
return a_items;
};
View User's Profile View All Posts By User U2U Member
naqvia
Member

Posts: 13
Registered: 4/12/2007
Location: USA
Member Is Offline
posted on 5/14/2007 at 09:57 PM Reply With Quote

"In free version you can implement it on top of the existing script by looping through .a_index array and looking at each tree item."

Where and how exactly?
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 5/14/2007 at 10:23 PM Reply With Quote

where: "on top of the existing script"
how: "by looping through .a_index array and looking at each tree item"
I even provided the samples how PRO version does this.
View User's Profile View All Posts By User U2U Member
naqvia
Member

Posts: 13
Registered: 4/12/2007
Location: USA
Member Is Offline
posted on 5/14/2007 at 10:55 PM Reply With Quote

I am just confused about why there are three different return statements? wouldnt just one suffice? my js skills are not that good, btw.
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 5/15/2007 at 03:05 PM Reply With Quote

Those are three different methods of the tree (the names of the functions are pretty much self explanatory). BTW: It is not unusual even for single routine to have multiple exit points. Anyway, if you're not comfortable with the coding you should ask a friend to help you or just go for the PRO version of the tree.
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page
Product Demonstrations Live Demos:
Frames targeting
Win help style
Free Download Free Download
Free Download Menu Builders
Online Builder
Product Documentation Documentation:
Documenation Page
Support Forum Technical Support
Support Forum
   

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004