[zTree] Cancel check/uncheck on parent node

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

Hi,


I need to return the original check value of the nodes. I've done it on a single node. What I need to return is the old check values of the child nodes of the parent node I triggered.


regards.

Hi Jeffrey, 

Can you elaborate a bit more on what you need? 

From my experience with the zTree I have the original values in database.


Regards

Vítor Correia wrote:

Hi Jeffrey, 

Can you elaborate a bit more on what you need? 

From my experience with the zTree I have the original values in database.


Regards

Hi Vitor,


My ztree works like this. After loading ztree from database, upon checking/unchecking a node there will be a popup asking for a reason why I need to change it, if I decided to cancel it the popup closes and I want ztree to return to its old value given I have checked a parent node with mixed checked values of child nodes. I can return if it's a single node but not if it's a parent node.


Regards


All changes are temporary unless I click the save button from the main page(where ztree is located).



Solution

SOLVED! 

In ztreedata, I made an IF condition if session variable is blank I will load the data from database, else I will load the session variable the updates every time a made a changes, and if i cancel the change I just ajax refresh the ztree container.

Solution

Hi Jeffrey,

Good to know that you solved it!


Regards