What is the meaning of the term 'nodes' w.r.t extjs? I understand the concept of a node w.r.t ..say an XML document...but what is the meaning of a node in extjs? i.e:When one does combo.view.getNodes() ,is the purpose to get a list of the items in the combo?
http://dev.sencha.com/deploy/dev/docs/source/DataView.html#method-Ext.DataView-getNodes
It seems it is used to get DOM nodes (i.e. HTML elements) that the combobox is build of.
Related
I'm having real problems with TreeViews BringIntoView implementation when trying to select things in the tree that are bound via ItemSource and ItemTemplate. It just doesn't work, I've tried pretty much all the fancy ways i could find via google and most don't work and if they do the wrong thing is always selected.
It would be be easier for me if i could just walk the tree one level at a time via treeview items instead of the the things i'd bound in.
Is there a way of "mapping" my bound hierarchical data template items back as treeviewitems?
NOTE: it would appear part of the problem with bring into view is that the items im loading into the tree is done in a "lazy" manner where the children are created until they shown - i have to do it this way as the dataset is huge.
To summarize: I can quickly search through my dataset and ascertain a "nodes" full hierarchical path quite quickly i.e. i can get "root\p1\p2\p3\data" easily enough, but I cant get a treeview thats bound to the dataset to display it using bringintoview. If I could walk the tree using treevitems i could find the node myself and call bringintoview on that. thats the plan anyway.
mucho tacks.
EDIT:
After some more searching I have found this http://blogs.msdn.com/b/wpfsdk/archive/2010/02/23/finding-an-object-treeviewitem.aspx. Which works buts also has problems - I can't initially expand the root object, and I can't work out how to seperate the ItemsPanel and ItemContainerStyle into toplevel styles/resources so i can share them about my other treeviews easily.
I am working on a project which is using ExtJS 4.1
I need to implement a tree grid with filters. As per my understanding from reading various articles, blogs and SO posts, ExtJS does not provide filter mechanism with tree store and we need to write our own filtering mechanism.
For filtering there are two approaches suggested:
1) Load the data into the tree grid and then show / hide the node based on filter conditions
2) Manipulate the store (copy the data and remove the record from the store)
I tried first approach. It was working perfectly with the test data (around 30 nodes).
But with the snapshot of production data, I was getting "Unresponsive Script" error in IE and FireFox. With Chrome it was working fine.
Basically the production database has large amount of data, around 3500 records which form around 900 nodes in the tree grid. I suspect, once the tree store is populated, while rendering all 900 nodes into the tree grid, I get "Unresponsive Script" error.
I am new to ExtJS and not sure what is the best way to tackle this problem.
I would like to know, how does filtering works on grid. Can I replicate same filtering mechanism for Tree grid?
Any suggestions to tackle this problem are welcome.
Instead of Tree if you can use Grid with grouping then use you can use Grid with filtering like this with pagination. If not then you can use something like Ext.grid.plugin.BufferedRenderer which can be used for TreePanel as well but it is available only on 4.2. If none of this is the solution for you then you have to create your own custom filtering than can handle pagination for you.
I have found that loading child nodes on the expand events of each node is a decent way to minimize the dom interaction of the tree panel. That way when you filter, it's only going to need to filter the first level of the tree structure rather than the entire thing. I have it working in an access control management application right now that is handling about 350 resources in one tree panel and two others with about 75 nodes each that are linked together through events. There's no noticeable UI lag with that approach but I haven't scaled it up quite to your scale and it would depend greatly how many items were in the first level of your tree whether or not that could work for you.
I would like to be able to display network-tree information (stored in hierarchical data structure), as in the example shown in here:
In the diagram, I have a number of hosts (top-level nodes) - one of which is considered the 'Master' and therefore rendered differently from the other top-level nodes. Each node can have multiple sub-nodes (probes). The lines between the nodes show connections and if any of the connections goes down, the line changes as shown between Hostname2 and Probe2.3. Any node selected (host or probe) should also be rendered differently.
I am using Prism/MVVM and I'm trying to keep the code as clean as possible, but I'm not sure of the best way forward for displaying this data.
I have considered using a TreeView but I cannot think of a clean way of creating the links between nodes. I also considered creating a custom panel, but I'm not sure that's the most appropriate and wouldn't know where to start. Then I thought of creating a custom ItemsControl, as it would be nice to use the DataTemplate and HierarchicalDataTemplate. I could also create a UserControl that contains a canvas and do everything in the code-behind there but it doesn't feel the best way.
I'd be grateful for opinions, example code, links or any suggestions you may have.
You're in luck, last year I had to write something very similar for my current job. I can't give you any of my code but I can lead you in the proper direction.
I found a directed graph collection class available here: http://msdn.microsoft.com/en-us/library/ms379574(v=vs.80).aspx#datastructures20_5_topic3.
I also use a Radial Panel I found on MSDN: http://msdn.microsoft.com/en-us/library/ms771363(v=VS.90).aspx. This allows multiple nodes to draw in a geometric shape. So if you have 3 nodes, they draw a triangle, 4 a square, 5 a pentagon, etc...The more nodes you have, the more the layout becomes a circle. This wouldn't work for you, but if you follow the link it shows you how to create a custom panel with a custom layout. It could be beneficial.
I then used a Canvas as the stage, with the RadialPanel as the Canvas' child element. Each node is just a WPF UserControl with an ellipses background that is added to the RadialPanel. The directed graph collection then become a collection of node view models. I store where the node is connecting, almost like a linked list. This allows me to traverse my graph collection easily without having to iterate each node to find the nodes I'm looking for.
There are some tricks involved in drawing to ensure the layout is proper, especially when drawing your connecting lines. See this StackOverflow post I made: WPF and C# - Issue with GeneralTransform and UIElement.TransformToVisual. It has a link to an image of my node graph so you can compare our graphs.
This obviously isn't everything, but I think it's a good start. For me, I couldn't really override any current controls to do exactly what I needed, so I went the hard way. The trade off is a lot of work in the code-behind and view models, but I also control the major aspects of how it's drawn. I this helps.
I have a WPF TreeView which varies in depth. My application also has the ability to search inside the tree. This is accomplished by using the Filter property of the ICollectionView interface. Searching and filtering all works fine, but the problem lies when I try to remove the filter.
I have the following scenario; I enter search criteria and the treeview is filtered and the result is shown. Now when I press my button to clear the filter, the filter is removed but the problem is that it shows only the child nodes of what I previously searched for and does not show the child nodes of the other nodes, these nodes are also not expandable anymore.
My search function recursively walks down the tree and tests each node for the entered search text.
Do I have to apply the view.Filter = null; statement for each node and their childnodes?
Thanks,
Grant
Yes!
Every hierarchy level has it's own ICollectionView and each uses it's own filtering. So yes, yu have to clear the filter on every (parent-)node (depending on your exact implementation).
I have a file in which some text is stored. Now I want to display the text in a list box using gtk. How can I do this?
Also the values are changing dynamically. Is there a way to refresh the listbox?
This is done using model-view architecture in GTK. The view is a GtkTreeView, and you can associate it with a GtkListStore, which you can update dynamically. The tree view will refresh automatically when you update the list store.
You might also want to read this overview of tree and list widgets in GTK.