Opened 14 years ago

Closed 13 years ago

#559 closed defect (fixed)

TreeNode disables too much

Reported by: henrik@… Owned by: ilia
Priority: high Milestone:
Component: Widgets Version: 0.2
Keywords: Cc:
Blocked By: Blocking:

Description

Now the TreeContextMenu automatically says you can't add a child to a treeNode, if the treeNode is not a folder. Resonable, but in my case I wanted to be able to change the node to a folder if the user wants to create a child. This has the advantage that the node looks nice, without + or - sign first, when it has no children. In my version of the createClicked function of the demo, I call setFolder() before I call the server, and that way I get the plus-sign on the transformed node. But first I had to change the actionIsDisabled method, otherwise the create option of the TreeContextMenu? is always disabled.

So I'm proposing that the actionIsDisabled function is simplified for TreeNode. If you want the current behaviour there is always the normal mechanism of providing actionsDisabled on the node.

Thanks,

Henrik Hjelte

New code below with old code commented away.

	actionIsDisabled: function(action) {
		var _this = this;

		//return (action == this.actions.ADDCHILD && !this.isFolder) || dojo.lang.inArray(_this.actionsDisabled, action);
		return dojo.lang.inArray(_this.actionsDisabled, action);
	},

Change History (1)

comment:1 Changed 13 years ago by wooyay@…

Resolution: fixed
Status: newclosed

tree widget now has a new property strictFolders="false". When it is set, all nodes accept children. Cool! Check out test_Tree_7.html

Note: See TracTickets for help on using tickets.