Deselect all children in partially selected dynatree - dynatree

I have a hierarchical dynatreee with checboxes. Clicking on a parent checkbox of a partially selected tree FIRST selects all of its children and then toggles between selecting/deselecting all the children. How can I make that FIRST click deselects all the children instead of selecting them?
Thx very much
regards, dejan

In your onSelect function try:
onSelect: function(select, node){
// visit all children of the node and deselect them
node.visit(function(node){
node.select(false);
});
}

Related

How to change v-model value only for the clicked element in an iterator component?

I have this iterator that displays several components:
https://codepen.io/anon/pen/zRyGmq
The problem is, when I click the menu button on one of them, the value of menu v-model changes to true for all of them.

Visibility of expanding last view in the expandable RecyclerView

I want the things in the last expandable item to be fully visible when it is clicked,Now what is happening means when I click on last item it expands down, but I manually need to scroll up again to see the the things inside the expanded item.How can the last expandable item be fully visible.
I am using Recyclerview.
I have found the solution which I wanted, I used
recyclerView.smoothScrollToPosition(selectedPosition);
after setting the adapter. So now the things in the last expandable item is fully visible when it is clicked.
Just a supplementary:
If you use h6ah4i/advrecyclerview, you can use the following code snippet:
#Override
public boolean onHookGroupExpand(int groupPosition, boolean fromUser) {
// NOTE21: collapse all other groups when one item expand.
mExpMgr.collapseAll();
// NOTE21: Visibility of expanding last view in the expandable recyclerview
if (groupPosition == getGroupCount() - 1) {
mRecyclerView.smoothScrollToPosition(groupPosition + getChildCount(groupPosition));
}
return true;
}

Unable to open right click menu when dojo tree node is not selected

I am using dojo 1.5. When I right click on dojo tree my right click pop up menu does not get created as first I need to select the treenode.
Is there any way of selecting a treenode when you right click on the dojo tree node?
There is no out of the box way to do this, but you can achieve this by adding an event handler for mouse down
dojo.connect(this.tree, 'onMouseDown', lang.hitch(this,this.onTreeRightClick));
onTreeRightClick : function(event)
{
if(event.button=="2"){
var node = dijit.getEnclosingWidget(event.target);
var nodes=this.tree.selectedNodes;
if(nodes.indexOf(node)>-1)
return;//if the node is already selected do not alter selected nodes.
this.tree._setSelectedNodeAttr(node);
}
}

Dojo Popup Menus - Connect a menu item event to multiple 'triggering' elements

What i have is a single dijit.Menu that contains the dijit.MenuItem objects with labels 1 - 9. It is connected to a sudoku like grid of 81 'nodes' (because there are so many, i dont bother with individual id's, i simply collect them with dojo.query('their-css-class-name')). This is the code i'm using inside of a widget to instantiate the context menu and its menu items.
var contextMenu = new dijit.Menu({targetNodeIds:dojo.query(".sudokuNode"), leftClickToOpen:true});
for(var i = 1; i <= 9; i++) {
contextMenu.addChild(new dijit.MenuItem({
label:i,
onClick: function(evt) {
//??
}
}));
};
contextMenu.startup();
What i'm trying to do is have the node that is clicked, and subsequently opens a popup/context menu, be filled with the value (1-9) selected from the context menu's MenuItems.
My problem is that i dont know how to "know" which of the 81 nodes was the one to fire the oncontextmenu event, and i dont know how to reference that node inside the 'onClick' method declared in the menu item.
Any help demonstrating how to reference the calling node in that context would be appreciated! If this isn't enough information, let me know what else i can do to explain my problem!
evt.target should get you the node that was actually clicked. Depending on the structure, you may need to do some other navigation from there, or use dijit.getEnclosingWidget().
If the MenuItems allow the events to bubble (I'm not sure; haven't used it myself), you could connect to the onClick() method of the Menu, so you've only got the single event listener in play.

flex edit menu operations on multiple textareas

I have a grid in which one column is having itemrenderer as textarea. My application is menu controled. Now I want to perform edit operations on the textarea using menu items.
Like if I select some text from a textarea in the grid, then I select a menu item "Cut" then it should cut the selected text from the textarea. In this manner I would lie to perform all operations.
I am not getting how to get that the operation is to be performed on which textarea?
inside your menu item click handler, try:
var fcs:IFocusManagerComponent = focusManager.getFocus();
if(fcs is TextArea)
{
var txt:String = TextArea(fcs).text;
System.setClipboard(txt);
}