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: Server side components question
Junior Member

Posts: 6
Registered: 6/9/2005
Location: Utah
Member Is Offline
posted on 6/15/2005 at 05:17 PM Reply With Quote
Server side components question

The code provided with the PRO version for dynamic creation of tree menu is great. I have a question though. When the user clicks on a node of the tree menu in a browser, I want to be able to find out which row in the database that node corresponds to, i.e., the primary key column value in the database. I can't rely on the caption, since it may not be unique.

During the dynamic creation of the tree menu, is there a way to stick the primary key value into each tree item somehow so that it can be used when the user clicks on the tree item?

Brian Barnett
View User's Profile View All Posts By User U2U Member

Posts: 687
Registered: 4/15/2003
Member Is Offline
posted on 6/16/2005 at 08:13 AM Reply With Quote

Yes, it's not a big issue. You need to modify build_hierarchy function (items.php), instead section
echo " ['$row[$cfn]', \"javascript:linkCheck('$clink')\", ";
if($id == 0) echo "{'st':1}";
else echo "0";
build_hierarchy($cid, $vn, $tn, $idfn, $pidfn, $cfn, $lfn);
echo ']';

use something like:

echo "['$row[$cfn]', \"javascript:linkCheck('$clink')\", {'myDBid':$primaryKey}";
build_hierarchy($cid, $vn, $tn, $idfn, $pidfn, $cfn, $lfn);
echo ']';

Note that items get IDs ('myDBid') in the item scope settings. To read the item ID via javascript try:
var my_DB_id = o_item.a_config[2]['myDBid'];
//where o_item - tree_item object
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Tigra Tree Menu
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
Tigra Tree Menu PRO
Product Demonstrations Live Demos
Multiple Trees
Frames Targeting
Icons and Styles Overloading
Event Handling
Performance Test
Version 1.2 features
Product Documentation Documentation
Documenation Page
Change Log
Support Forum Technical Support
Support Forum
Customer Care System
Order Now ORDER NOW!
Add to Cart
View Cart

Go To Top

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