Skip to main content

When you click on tree control parent node name and later on click on "+" button to expand that node changed event executes multiple times depends on the child element present inside that parent node.

 

See Below example:- When i click on Parent1(text) and then click on "+" button of Parent1, event fires 2 times. If i do same on Parent2, event fires 3 times.

 

+ Parent1

    +Child 1.1

     +Child 1.2

+Parent2

     +Child 2.1

      +Child 2.2

      +Child 3.3

How to solve this issues in K2 5.3 version?

Hi bhushanborole

 

See the attached linke below for a fix

 

https://help.k2.com/kbs100103

https://community.k2.com/t5/K2-Five/Tree-control-The-quot-Tree-is-Changed-quot-event-executes/ta-p/102603

 

Should you find the information from the article useful or leading you to the answer please mark as "Solution and/or Kudo", as it will assist other k2 developers with relevant information in the near future.

 

Best Regards

Elvis

 

pK2 will not accept any liability for any issues arising from actions taken in respect of the information provided by any forum member]


I already went through that articles and if i set the Load Ahead Level property to 2, It works only upto 2 levels.

 

I have more than 9 level of tree structure.  If we setup Load Ahead Level property more than 2 it causes performance issue as well.


Hi bhushanborole

 

You can log a ticket to support and request for  assistance 

 

Regards

Elvis


Below solution works for me and it is work around for Tree View Control:-

  • Keep Load Ahead Level property to 1 (As default setting) or set to none.
  • On Tree Change Event add below Advance Condition to check ID of parent node if it not equal then only execute logic(rules) that you want.
  • Add Data Label(Flag) on View or Form and set Value as 0.
  • Add below condition in Changed Event:-
  • When Tree is Changed
  •    If an Advanced Condition is True (Tree is not empty & Flag is not equal to ID) See image Tree.png
  •           Execute Your Logic Rules.
  •           Set Flag = Tree Current ID (View -->Control-->Tree-->Data Source-->ID) See image Tree1.png

So on changed event it will not loop mutiple time for same ID of your clickable parent node.




Reply