I have two tree panels tree1 and tree2 and one form panel in my application.I added drag and drop plugin for both the tree panels.If i drag from any leaf node from tree1 panel to form panel,the particular details of that node will display in form panel and the selected leaf node get updated in the tree2 panel. Now if i drag and drop any leaf node from tree2 panel,the particular details of that node in form panel and selected node from tree2 panel has to be removed.
I can accomplish what i said so far.
Now once again,if i try to add drag and drop operation for tree1 panel after remove operations performed in the tree2 panel i am getting the following exception........
uncaught exception: [Exception... "Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMHTMLDivElement.insertBefore]" nsresult: "0x80004003 (NS_ERROR_INVALID_POINTER)" location: "JS frame :: http://extjs.cachefly.net/ext-4.0.2a/ext-all-debug.js :: :: line 15686" data: no]
Any help appreciated...
Thanks in advance.....
Related
I am using jsTree with "data" option where in I fetch the JSON data myself (instead of using jsTree's AJAX option) and then render the tree.
How do I show the expand/collapse icon programmatically? i.e. if I know the number of child nodes for a particular node, can I show the expand icon and then have an event attached to it so that I can lazy load the child nodes?
I tried setting li_attr["class"]="jstree-closed" but it ends up adding this class to the already present "jstree-leaf" class on the 'li' node and so the expand icon does not show up.
You have to set the "children" attribute to true on the node where you wish to show the expand icon.
Example:
{
text: "My node",
children: true
}
Source: Populating the tree using JSON
I need some elements that are the childs of some 3-4 panels, but in those panels I can identify only the 1st parent panel and rest don't have any identifiers, so please help me to find the descendants of the 1st parent panel.
let's say - Parent#1 only can be identified as "workspace" but the immediate child panels are not detectable (Edit#1/ Edit#2 and button under unknown panels are identified), so i want to reach to the edit boxes, please help?
Try this
Use SearchCriteria to find the parent Panel1
Use the GetElement method in TeskStack.White.UIItem:
Panel1.GetElement(SearchCriteria searchCriteria)
I can click on a node to select it, it marks node as selected.
Multi select works great as well.
I can then drag the selected node(s)
However, without the above mentioned selection Dragging a node does not select
it (.bind("select_node.jstree", function (e, data) only fires on mouseup)
If i have nodes selected and then drag another node ; these previously selected nodes are not deselected.
Basically,how do i emulate windows explorer drag and drop functionality ?
to deselect the previously selected nodes, just call this function before selecting the current node.
$("#tree").jstree("deselect_all");
Call the above function and then go on with selecting the current node followed by your code.
Cheers!
We're using GWT and We're required to create two drag and drop tree grids. Each tree contains parents and children (max two level for now).
Here's what we need to be able to do:
Use cases
Drag a parent from one tree grid to the other.
Drag a parent 1 to parent 2 (1 will become child of 2, and all 1's children will become children of 2) -> please don't ask :D
Drag a child from one parent to another (within the same tree grid)
Drag a child to top level within the same tree grid (child will become a parent)
Drag a child to the other tree grid with two options
1 - Top level - child from tree 1 will become a parent on tree 2.
2 - Parent - Child from tree 1 will become child of a parent on the tree grid 2.
If this doesn't make much sense, we don't have the full context yet, so that's all we know.
Problem
We can drag on the same tree grid. If the row we want to drag the cell to is hidden, we set the scroll to true, so that the grid scrolls when the user is dragging inside it. Something like so:
private void setDraggableOptions(DragAndDropColumn<?, ?> column) {
// retrieve draggableOptions on the column
DraggableOptions draggableOptions = column.getDraggableOptions();
draggableOptions.setScroll(true);
// use template to construct the helper. The content of the div will be set
// after
draggableOptions.setHelper(HelperType.CLONE);
// opacity of the helper
draggableOptions.setOpacity((float) 0.8);
// cursor to use during the drag operation
draggableOptions.setCursor(Cursor.MOVE);
// set the revert option
draggableOptions.setRevert(RevertOption.ON_INVALID_DROP);
// prevents dragging when user click on the category drop-down list
draggableOptions.setCancel("select");
column.setDraggableOptions(draggableOptions);
}
Now the problem is, setting the tree grid to scroll, the user will never be able to drag the object to the second tree as the scroll will try to keep the object always inside the grid.
We're using the gwtquery-plugins
Is there any idea to work around this? Thank you very much in advance.
See my response to your question here
I am using GWT 2.4. I am using Tree in my project. I want to move tree node up or down on Button click next to particular node. Is there any way to do so?
#Janki, You can try the following property of Tree to reorder TreeItems attached to it.
myTree.insertItem(beforeIndex, item);
This property inserts a child tree item at the specified index containing the specified
text, where beforeIndex is the index where the item will be inserted
& itemText is the text to be added.