[zTree] What is the clickFlag used for?

Forge Component
(14)
Published on 2017-02-13 by Eduardo Luís
14 votes
Published on 2017-02-13 by Eduardo Luís

Hi All, 

Can anyone provide the use of the clickFlag parameter used in the Basic_11_ClickWeb Block in the zTreeExample? 

What values can it assume and what do those values entail? 

Thanks, 

Nicholas

Solution

Hello Nicholas 

The clickFlag is a local variable that has the following integer values depending on the click/ selection of a node 

0 : No node is selected 

1: A single node is selected 

2: More than one node is selected 

As stated in the example, It uses the 'beforeClick' and 'onClick' callback functions 

Hope this helps !!! 

Solution

Amal Raj wrote:

Hello Nicholas 

The clickFlag is a local variable that has the following integer values depending on the click/ selection of a node 

0 : No node is selected 

1: A single node is selected 

2: More than one node is selected 

As stated in the example, It uses the 'beforeClick' and 'onClick' callback functions 

Hope this helps !!! 

That's pretty much it!

That's a way of knowing what is happening in the tree and act accordingly.


See the original example and the original api for more info.


Amal Raj wrote:

Hello Nicholas 

The clickFlag is a local variable that has the following integer values depending on the click/ selection of a node 

0 : No node is selected 

1: A single node is selected 

2: More than one node is selected 

As stated in the example, It uses the 'beforeClick' and 'onClick' callback functions 

Hope this helps !!! 

Hi Amal, 


Thank you for the great explanation, this is exactly what I was looking for. 


Nicholas van Wyngaard wrote:

Amal Raj wrote:

Hello Nicholas 

The clickFlag is a local variable that has the following integer values depending on the click/ selection of a node 

0 : No node is selected 

1: A single node is selected 

2: More than one node is selected 

As stated in the example, It uses the 'beforeClick' and 'onClick' callback functions 

Hope this helps !!! 

Hi Amal, 


Thank you for the great explanation, this is exactly what I was looking for. 


Happy to help !!!