Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
15
How to access the primary key of a dropped node??
posted

Hi all,

This is Sameer.  I have a question related to UltraWebTree(version 2009.2). I have a hierarchical data in DB in 3 levels. I have bound the data using Hierarchical Data source, where the SQL data source at each level is feed either by a stored procedure or custom query (because the data obtained is not straight data from the DB)

Level 1: 

Years ( 2009,2010,2011 etc..)

Level 2: 

Semester ( Spring 2010, Summer 2010, Fall 2010 etc) whose primary key is a code for each sem

Level 3:

Courses under each semester, where a user can move courses from one sem to another sem. The primary key for courses is not same as the course description that is displayed for the user in the tree.

Now here is the scenario. Say a user has moved a course from Summer 2010 to Fall 2010. 

 

  1. How can I catch the primary key values of the semester on which he has dropped?
  2. How can I catch the primary key values of the course that the user has moved?
  3. How to restrict a user to move only courses level, but not Semester level and Year level?

 

No check boxes are provided and the user don't click the node first and then drag it to be dropped on another semester.

I tried to access the primary key values from e.node.datakey,  e.node.tag etc but all I am getting is the description/ text of the node but not the primary key value.

Any help in this regard is really appreciated. Hope I get a positive response.

Thanks in advance.

  • 15
    posted

    Forgot to convey my Thanks in advance. 

    Thanks a lot 

  • 15
    Suggested Answer
    posted

    After searching for some other thing I found the solution for this. After seeing the solution, I felt that how did I miss this point?? Very bad on my side.

    Anyway, for others not to miss this, I am posting the answer.

    In Hierarchial data sourse,

    1. In parent Node: select primaryKey, Text field data from the source

    2. In child node: select childNodeprimaryKey, parentNodeprimaryKey, childnodeText from the source

    Now in the design of UltrawebTree, in NodeBindings, link the tag field with the primary key and text field as text that you want to display. Now you can access the primary key using oNode.getTag() where the tag field gives the primary key of the child/parent on a valid action.