Extjs4 Check-tree: tri state checkbox on nodes to summarize leaves states - checkbox

Is it possible to incorporate tri-state checkbox in a ExtJs check tree?
By tri-state, I mean the parent node is:
Checked if all children are checked
Unchecked if all children are unchecked
Grey/Filled if some children are checked but not all
Something like this:
http://shamsmi.blogspot.fr/2008/12/tri-state-checkbox-using-javascript.html
I found this to create tri-state checkbox for regular forms:
http://www.sencha.com/forum/showthread.php?138664-Ext.ux.form.TriCheckbox&p=619810
But I don't know how to apply this custom checkbox to the tree view, or even if it possible.
Any idea?

Related

Material-ui - Treeview Expand all

Using material-ui/lab 4.0.0-alpha.27 - TreeView Component
I have a treeview with a couple of hundred nodes. I have added a textfield before the treview that the user can use to search/filter the tree. As they type I add/remove classes from the TreeItems to hide and show TreeItems. It works fine BUT we want all of the nodes to be expanded once they enter something into the search/filter textfield.
I have tried feeding the "defaultExpanded" prop a new list that has all of the nodes in it but it doesn't seem to cause the nodes to expand as I had expected. The defaultExpanded prop only seems to be respected when the tree initially draws.
I am currently working around this by looking for collapsed nodes and firing click events for them to force them to open but that is causing issues (the textfield looses focus and the keyboard hides and the treeview jumps around). I need something a bit smoother.
You need to use the expanded prop, instead of defaultExpanded.

Checkbox tree with Buttons in reactjs

I have a specific requirement to add a Checkbox tree having Action buttons on each node.
As I am new to Reactjs, I tried certain options like react-sortable-tree and react-checkbox-tree, which solves either Action Button or Checkbox requirement.
https://www.npmjs.com/package/react-sortable-tree
Could I get help to find necessary control or control behaviour to fulfil the requirement acceptance?
Thank you,
Sagar
There is rc-tree which is used by Ant Design it has checkable property which makes each tree node a checkbox.
If it does not solve your problem you can create a custom tree view yourself. There are plenty of examples on web (How TO - Tree View).

Fuelux Tree: How to filter items based on status checkboxes

I have successfully implemented the FuelUx tree control but I want the user to click a different status check mark (IE active or archived) and only display the child items in the tree that contain the selected status.
Any suggestions on how to implement this feature?
Thanks,
Greg
My first inclination would be to add an active/inactive/archived/whatever class to the data source attr.cssClass key.
http://getfuelux.com/javascript.html#tree-usage-datasource
This would allow you to toggle which item state is being displayed at a given time. You could also use styles connected to the class to customize the icon based on the state.

how to show/hide children in an angulartreeview?

I am looking at the angular treeview (https://github.com/eu81273/angular.treeview)
How to show/hide the children in the tree?Or do I just need to bind to a different model?
It looks like each node can have a boolean property called collapsed that determines whether or not its children are shown.
For example, you can collapse the second child node of the root node like this...
treeList[0].children[1].collapsed = false;
Fiddle (simplified version of one of their samples)

Checkbox behavior in RadTreeView control

I am using a Telerik RadTreeView control to build a tree with nodes containing checkboxes.
The default behavior for this control is that if you check a parent node, all of the child nodes within it will also become checked. Is there any way to change this behavior? I want to be able to check a parent node on or off and not have it affect the children.
Thanks
I would try doing some magic when the PreviewChecked event happens. I'm not sure, but maybe you can use it to detect a checkbox is about to become checked, and prevent this from happening if it is not the checkbox the user actually clicked in.
You could also do some stuff in javascript like this
function checkNode()
{
var selectedNode = treeView.get_selectedNode();
if (!selectedNode)
{
alert("You need to select a node first.");
return false;
}
selectedNode.set_checked(!selectedNode.get_checked());
return false;
}
This is straight from telerik but simply loop through all the children nodes and turn them back off (or back on when you click it off). The problem is if you want to maintain the state of the children nodes regardless of the parent. Then you need to hold that info in some variable.
The other option is if you don;t want the children to even have checkboxes, then simply don;t make those nodes "Checkable" in the server side code. (I'm sure there is a way in the client side too)

Resources