I have one treeList that has one parent node and a number of childs. When loading if I click on parent(root) node it is not selected and the eventHandler for the node is not called. Just if I select one of its childs and then select the parent node it will call the eventHandler for selecting that node.
I would appreciate any help on fixing that.
I have solved this problemy by seting treeList.FocusedNode to null (or Nothing in VB.NET) in the form constructor and then adding handler for FocusedNodeChanged event (it cannot be assigned in the designer code!).
Regards,
Maciej Nowicki
Related
I have a QT5 application in which I have to simulate a tab keypress on an external event i.e. I need to cycle through the taborder list and setFocus on the next element.
I cannot find any method to get the tab-order list programmatically. What would be the best way to do this?
How about a combination of QWidget:: nextInFocusChain() / previousInFocusChain() and setFocus() method or setFocus() slot? (There are some other ways to set focus as well, all cross-linked in the Qt docs.)
nextInFocusChain()and previousInFocusChain() provide public API access to the underlying private members which seem to control the tabbing order. You can see them being used in QWidget::setTabOrder() for example.
Current focus widget could be found with either QWidget::focusWidget() of the parent widget, or QApplication::focusWidget(). Note that QWidget::focusWidget() will also return the first widget in the focus order if none currently have focus. This starting point could be used to build a list of widgets in tab order.
I'm trying to create a prototype in asp.net web form where clicking on a treeview item changes views within a multiview. I've created all the views that I need and I now need to configure it so that clicking on a treeview item will change the multiview to the corresponding view.
My treeview has this structure: A project has 2 subcomponents: parts, users. Furthermore, parts can have multiple subparts. So when clicking on a project, I want to load the view associated with projects, in this case, its called view1. And when clicking on a part, it should load view2, and so on.
My best guess is that I can somehow extract the level(counting from root) of the selected treeview item and from there load its view. But how would I do that? Also, since project has 2 subcomponents which each have its own view, a treeview item level might not be sufficient since both parts and users will be on the same level. So how would I go about solving this?
I've figured it out.
TreeView.SelectedNode.Depth provides the level at which the selected node is at. I thought I had to do some recursive traversal from the selected node and stuff like that but looks like its a lot simpler than that. =)
I still have the problem of having multiple views that correspond to the same depth though.
Here's how I did it.
On my page I have 2 columns. On the left is the treeView1 and on the right Multiview1 with several Views.
Page Load is set at MultiView1.ActiveViewIndex = 0
By double clicking the TreeView in Design Mode, it creates the Sub routine Handler
Protected Sub TreeView1_SelectedNodeChanged(sender etc etc etc)
End Sub
I added the following code inside the Subroutine
If TreeView1.SelectedNode.Value = "value of the treeview node" Then
MultiView1.ActiveViewIndex = 1
End If
Is there any build in javascript function to expand/collapse any treeview particular node from client?
Actually I am using treeview with checkboxes enabled and I want to have a particular node collapsed and unchecked initially, and when checked should be expanded.
Any built in thing or idea?
I couldn't find any way yet...
Edit:
I tried checking if collapsed nodes are invisibly(display:none or something) available on the page so that I can play with some javascript to make them visible on checkbox changed of parent node, but found they are not at all rendered on the page :(
Found the answer!
I was wrong, it does render collapsed nodes with [display:none] and so my problem is solved.
I am now binding client onclick event on treeview and there I am making collapsed nodes visible when there parent node is checked, as per my requirement.
Thanks!
I have a Flex (3.5) Tree with drag & drop support, but the problem is that after I drag an item (node) and drop it, it's supposed to be the selected item in the tree, but for some reason it's not highlighted. Does anyone know how I can fix it?
Thanks.
I'd try to set the tree's selectedItem property in the dragComplete event.
I ran into this problem too; and based on the fact that the tree had not re-settled visually when the onDragComplete breakpoint tripped, I placed the following in my onDragComplete handler method:
callLater(function():void{
treeGrid.selectedItem = draggedItem;
});
That worked-selected item was highlighted.
I have a spark list control whose data is rendered using an itemrenderer. Basically the Item renderer lays out the data within a Panel.
The Panel has a LinkButton, which when clicked needs to pass an Id to the parent application. In the parent application I have a function that dispatches a custom event to its parent. I want to know how to call this function from the ItemRenderer.
I tried using parentDocument.outerfunction etc but it throws an error..
Any clues ?
I would have your item renderer dispatch a custom event that contains your Id, making sure that your event bubbles. Then in the parent application listen for that event and call the appropriate function. Hope that helps.
If I understand well you can try to call from the item renderer this.parentApplication or this.parent.parent.
The best way is to create a custom event and bubble .. and add an event listener for that event in parent document..
this is working I have test parentcomponent(this.owner.parent).function...owner is list and parent is the component in which list is placed e-g InvitationList(this.owner.parent).invitationAccepted(persist);
type cast the this.owner.parent to your parentclass
If you were using PureMVC, you could send a notification that the receiver would handle and perform the needed work. This is similar to firing a custom event and receiving it in the parent.