Select all children without selecting parent - fancytree

I am using fancytree's multi-hierarchy select mode (selectMode 3) to select which nodes to remove from the tree. The problem is when all the children are selected - the parent is selected as well, but the user may not want to remove the parent from the hierarchy. I checked the documentation and other Stack Overflow articles but couldn't find a workaround. Any ideas? Thanks!

As the author notes in https://github.com/mar10/fancytree/issues/626 , this situation could be handled by using selectMode: 2.
This mode does not implement any additional logic on its own.
But the click event can be implemented and data.node.visit() can be used to modify the selection state of child nodes.
One complication though is that all child nodes may need to be selected when a parent node is selected. It may help to disable child nodes when the parent is selected.

Related

Refer relevant K2 smart objects from different sources in a K2 view

I have recently started working on K2, so please take me as a starter on this one.
SmartObjects
1) I have a SharePoint Smart Object (SpSo1) which lists all vehicle details i.e. ID, make, model, specs etc.
2) And I have a SQL Server Smart Object (SqlSo1) where I am saving only the vehicle IDs against the ProcessInstance_Id.
View
The View is a Smart Object List View which is linked to SqlSo1. In the Edit Section, it has a picker control which is linked to SpSo1, and some DataLabel controls used to display selected vehicle specs. This View also contains the toolbar buttons i.e. Add, Edit, Delete Save, Refresh which execute their relevant functions using SqlSo1. The View also has a parameter called ProcessInstance_Id.
Working
When the view loads it should retrieve and load in the List Section (picker column) the list of all vehicle IDs from SqlSo1 saved against provided ProcessInstance_Id parameter. Simultaneously, against each vehicle ID loaded, it should also retrieve and load into the DataLabel columns the vehicle specifications from SpSo1 against each vehicle ID loaded.
The Edit Section in the View should allow to pick (in Picker control) and load (in DataLabel controls) vehicles using SpSo1 (which is achieved). Whereas the List Section should display data of vehicles retrieved from SqlSo1 such that Vehicle IDs retrieved from SqlSo1 and their other spec details retrieved from SpSo1 (Still to achieve and is the real question here).
Please help me in this regard. that would be so kind of you.
I have been finding difficulty resolving my issue that I raised here exactly a week ago but to the reality of this Forum I have not received even a single response from any of its gurus. and I have suffered at my work due to this.
I know I am quite new to K2 but you guys are gurus, you could have suggested at least something on my query.
Honestly, if StackOverflow is only to edit the posts and not suggest on the actual query then my suggestion to StackOverflow founders/CEOs is "SHUT IT DOWN".
Thank me.
to achieve that, you would need to add additional column to your view and to change it to List Display - where you would in turn change "Display" property of that control to show properties from SharePoint list.

NetSuite workflow to update a record of different type

I have two NetSuite records that have a parent-child relationship. Let's call them P and C
The Child records (e.g. C123,124, etc) are listed on the Parent (P987) in a sublist.
I have a need to display the most recently updated child record (e.g. C124) in the main area of the related Parent record. I need to display 3 fields from that child record:
name
field1
field2
Second question: I might need to make one or more of fields displayed above (e.g. field1) editable. If so, would I have to store that as fields on the parent also? And then how would I keep this "copy" updated in sync with that specific Child record?
It doesn't have to be a workflow but I prefer to use "supported" features (such out of the box workflow actions) as much as possible and avoid customization by scripting. If you don't think it can be done without a script then please be clear.
P.S. Fairly new to NetSuite but not the concepts.
P.P.S. no I am not happy about the problem above and wish I could prevent all silly requests. lol
First one you can achieve with a Workflow action script.
Second question, if those are custom fields, you'd have to make them populate the info on the child record, this can be done from the same WFA script.

jcr:lastModified vs cq:lastModified

What is the significance of having 2 separate last modified dates(jcr:lastModified and cq:lastModified)? Is there a scenario where one of the dates gets updated and second one not. Cant we live with one of the last modified (maybe jcr) and use it everywhere?
My issue is, we have few queries and conditions in our application defined based of either of these dates and am confused if the usage is right.
Here is a sample:
cq:lastModified is present at jcr:content node level, means it is available on all those nodes whose jcr:primaryType is cq:pageContent. Where as at all other nodes types jcr:lastModified is used. In general we can say that if any content is getting modified through aem functionality it will refer and update cq:lastModified and everything else that is using JCR core functionality will refer and update jcr:lastModified. Both properties can’t be present on the same node.
Read more at WHAT IS THE DIFFERENCE BETWEEN JCR:LASTMODIFIED AND CQ:LASTMODIFIED
I think one should always check both properties. I'm currently facing the situation that updating an image with the ootb image dialog is not changing the cq:lastModified property. however, the jcr:lastModified property is either added or modified. This a very curious behavior I'd say. I'm not sure if I'm missing something in my dialog config:
Can be caused by the fact that the image tab is embedded in another dialog ... but I'm not sure
Any modification on page by an authoring activity i.e. on component dialogs or page properties dialog, it always associated with jcr:lastModified and jcr:lastModifiedBy properties on the respective nodes (i.e. if content modification is done on component then node type is nt:unstructured and if it is page properties like jcr:title then it is cq:pageContent).
For each content modification on the page as part of authoring activity, cq:lastModified and cq:lastModifiedBy properties on the jcr:content node gets updated; no matter on which component the modification have been done. Hence, if there is a modification on page properties like jcr:title then on jcr:content node, cq:lastModified, cq:lastModifiedBy, jcr:lastModified and jcr:lastModifiedBy property values get changed.

Unity3D - Prevent Grid Layout Group rearrange

When i delete an item in grid, grid will rearrange the rest of items, it means they will fill the empty slot of deleted item by others
Is there any way to prevent this ?
Have your GridLayoutGroup contain a set of child container game objects (pseudo speak).
In each container, place the item you desire.
Then, rather than deleting a container, delete the item inside the container instead.
This way, the containers stay in place, and only the items inside get deleted. Therefore, no rearrangement will occur.

gwt - dynamic tree structure using uibinder

I have a tree structure which has sub nodes and these sub nodes in turn have their own sub nodes.
I now want to add click handlers for the root node and every child node. Can any one please help me that?
Thanks
There is no need to add a ClickHandler to each node. It is very inefficient. You need to add a single SelectionHandler to your tree.
When you create each TreeItem, you can set a user object on this item. In your SelectionHandler, you check what user object is set on the selected item, and then you act accordingly.