I have a table in my database which keeps track of a 3 level hierarchy. What is the best way to display and change/modify this hierarchy? Which asp.net control to use and how?
I can give you some ideas from the little informations that I have.
First in the database, just use a field that point to the father of a line. Using this father ID you can make any simple tree.
The easiest way to modify it is just change this father and take care to not make any dead cycle loop.
Second way is to use jQuery and any Tree control, to modify the tree.
For example this http://www.jstree.com/
or this http://www.prodevtips.com/2010/03/07/jquery-drag-and-drop-to-sort-tree/
are very good jQuery javacript code to show and change the hierarchy.
Using any of this jQuery plugin you can render your tree, and after the modification to get the changes and saved back to your database.
Related
I have got a set of data that goes by hierarchy. For argument sake, let's say this is the top level:
The user should be able to drill down on one of the boxes to explore the data. When clicked, the user sees the second level of data:
Alternatively, the second level of data can totally cover the first level (but have a breadcrumb that shows the drill down journey):
I am hoping to be able to implement such visualisation tool on ASP.net (i.e. web). Does anyone have a suggestion on a suitable JS / extension plugin?
Thank you kindly.
You can use jsTree jquery plugin. It gives very nice interactive UI in hierarchical level. It provides support like drag & drop support, inline edit, create and delete etc.
You can get it from https://www.jstree.com/. It is easy to use.
I am looking for some advice in regards to getting a very quick display of our reports. The problem I am working with is I receive an XML data structure that defines our layout. The report can be anywhere from 2 to 3 pages to perhaps 20 to 30. So to make the report display as quickly as possible I would like to just render the visible portion of the report. Here are the issues I need to overcome to accomplish this and I am looking for some advice how how to accomplish this.
To get a better visualization, Think of this like a word document. The reports have sections and I want to be able to get them to display as quickly as possible.
1) Of course I do not know the height of the child components I will be adding. Is there any techniques where I can determine if the components I am adding are not include in the view port and could I trigger off scroll bar movement.
2) I was thinking of adding estimation to the children components and then using that to set the height of the parent container. then when I receive scroll bar move event, I would check if the child components have been added to the parent and if not add them. Is there anyway to get the height of a component without rendering it?
3) Does Flex support anything built in that will accomplish this.
Any other techniques would be welcome. Basically I want to get the report displayed to the user as quickly as possible and delay the rendering of components that are off the screen.
Any suggestions would be welcomed. Thanks in advance.
Added Info.
Hard to provide code since I have not coded it yet. Let me try and expand with some details. I have a Parent Container where I take the some XML and using the XML creating children components based on the information in the XML. Right now when we do this it can take a long time to render a long report. What I want to do is to reduce the rendering time by delaying the rendering of those children objects. I have looked into things like the creation policy and createDeferredContent, but not sure if this is the right way to go. Guess the general problem I need to attack is how to do you stop rendering objects once you are outside the parents viewport. What I want is an item renderer like functionality but there is no similarity between the children. Perhaps a picture might be useful (will add as soon as I get to 10 points)?
Use spark List with useVirtualLayout turned on. This is what it does.
There is always similarity between children, but if you can't find it, you can use an itemRendererFunction.
In Drupal I have the page content type. I have created a vocublary and the terms in it make a heirachy as below:
Bird
Mammal
Dog
Poodle
bulldog
Cat
Tiger
Rabbit
Reptile
Lizard
I select the term when I create a content type. I wish to display all the pages that have have this conent type in a menu (unordered list) maintating the heirachy above. Is this possible? Which modules would you use to do this?
You could use the taxonomy_menu module.
The module page: http://drupal.org/project/taxonomy_menu
This module renders a vocabulary into a menu. If this is not what you need (e.g. if you want to display ths vocabulary in a node content), I think you have to write a simple module for it that gets triggered in hook_nodeapi().
With the views you would be able to get very far in this matter, but I'm not sure if it is worth it in this case. The thing with views, is that it can be a bit tricky to generate the markup you want. With views it's possible to create any kind of markup you want, and make it display whatever you want. However, sometimes the work required to get there is not worth it vs just making your own module to do it.
You should try to look into views first and see if you can get what you want.
If you're not able to get what you want, I think creating your own custom module is the way to go. I don't know if there is an api function to get the nodes, but it should pretty simple query required to get them. Then you have the power you create the markup exactly how you want. You could just create a theme function to do all this that you can call in your theme.
In my way of learning drupal, I got stuck in this issue. I have Taxonomy vocabularies that I set as tree with each node have different depth. Now, I need to display it in select box in a way that only one select(the parent terms) at first. On change, it will fetch term's children and display another select box below it. This goes until the last term doesn't have any children.
How do I do that in drupal?
I'm not sure I understand the question, but I think Hierarchical Select could help if this is a question about the UI
not so clear question, may be using http://api.drupal.org/api/function/taxonomy_get_tree/6 will be helpful.
[edit]
You can use the depth parameter to make sure that you only have the top level items in your first select. Then you can (through an ajax callback) get sub items using the parent parameter.
I want to accomplish the following scenario in Drupal:
You have 2 content-types. Lets say, an application-form for a lisence, and a content-type for persons.
Then when you go to add a lisence in the "node/add" submission form in Drupal, i would like to add a relative number of persons that would be related to this lisence, and only this lisence. Say you would like to apply for a lisence, and relate 4 persons to this lisence, then insted of creating the lisence and then create the 4 persons and relate them to the lisence, i would like to do this "inline".
So when i add a lisence, there would be a way to add 1 or more persons that would relate to the lisence node. Is this possible, and if so how?
I have been looking at the node reference module, and that manages to reference a node to another, but not to add them inline with the other.
With the web-development framework Django, there is a way to this with something called "inline-editing", where you get the content-type fields inside another content-type creation form. There you bind them togheter with a ForeignKey.
Anybody know of something simular in Drupal, if not, is it another way to achive something simular, that would be as user-friendly?
The Popups: Add and Reference module has recently been improved and I think it might do what you are looking to do.
Try Node Relationship, it will add buttons for edit/view/add next to the node reference field and will pop up a modal. Make sure you check the module dependencies.
I have looked into this, and it doesnt seem to be possible. I have looked at the reference_create module, and searched and posted stuff on drupal.org, and nobody have a nice solution.
So what I just rebuilt the whole thing in Django in about 3 hours; so, tomorrow I will try to convince my employer to go the Django way!