hierarchy

Construct hierarchy tree from flat list with parent field?

孤街浪徒 提交于 2019-11-26 16:07:52
问题 I have a list of "page" objects with a parent field. This parent field references another object in the list. I would like to create a tree hierarchy from this list based on this field. Here is what my original list looks like: [ { id: 1, title: 'home', parent: null }, { id: 2, title: 'about', parent: null }, { id: 3, title: 'team', parent: 2 }, { id: 4, title: 'company', parent: 2 } ] I would like to convert it into a tree structure like this: [ { id: 1, title: 'home', parent: null }, { id:

Make multiple dependent / cascading selectOneMenu dropdown lists in JSF

你说的曾经没有我的故事 提交于 2019-11-26 15:27:22
I am trying to make 4 dependent menus. When the user chooses an item from the first menu, the second menu will show dependent data and when the user chooses item from the second one , the third one will show dependent data and so on. The user will see items on the first menu only and the other ones will be blank. If he chooses an item on the first menu the second one will show data but the third and the fourth will remain blank, and so on. The user must eventually choose entries from all the 4 menus. <h:selectOneMenu id="first" value="#{nodes.selectState"}> <f:selectItems value="#{nodes

How to implement hierarchical multilevel datatable in javaScript?

☆樱花仙子☆ 提交于 2019-11-26 14:50:20
问题 I am implementing multi level datatable without using any plugin or library. I want to implement based on javaScript, JQuery or angular js. I checked one below links, Traverse all the Nodes of a JSON Object Tree with JavaScript nested table using ng-repeat But my json structure is different from above link. I need to display my JSON in Tree Structure UI. I don't hard code level in html. All level should be handle by javascript. I have implemented jsfiddle: http://jsfiddle.net/varunPes

How to view hierarchical package structure in Eclipse package explorer

与世无争的帅哥 提交于 2019-11-26 13:58:13
OK here's what I would like: in the Eclipse package explorer, I see the following: (dot represents a clickable arrow that I can use to expand the folder) PROJECT Source Folder Package Class Package.SubPackage Foo Bar Package.OtherSubPackage Package.OtherSubPackage.VerySubPackage OtherPackage Foobar OtherPackage.SubPackage Baz Long story short, I want to have many packages, each with many subpackages, in a source folder (and several source folders, so making more won't solve the problem)--so on the order of a couple hundred packages per source folder--ten to twenty packages each with fifteen

Moving a git repository up one hierarchy level

心不动则不痛 提交于 2019-11-26 12:23:28
问题 Git beginner question: I have a small private webproject which is versioned locally with msysgit. There is no exterior repository, as it\'s only for me, so i can bascially do whatever I want. I\'ve had this set up in the project directory, ie in \"webroot\". Now a second directory had to be created, placed parallel to webroot. Let\'s call it assets. So structure is now as follows: \\ project directory ----\\webroot ----\\assets I\'d love to include this new directory in the git repository, so

Category Hierarchy (PHP/MySQL)

冷暖自知 提交于 2019-11-26 10:23:48
问题 I am trying to get my all categories and sub-categories from MySQL database in a hierarchy: My result should be like that (just example): Cat A Sub-Cat 1 Sub_Sub_Cat 1 Sub_Sub_Cat 2 Sub_Cat 2 Cat B Cat C ... MySQL code: CREATE TABLE IF NOT EXISTS `categories` ( `category_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `parent_id` mediumint(8) unsigned NOT NULL DEFAULT \'0\' COMMENT \'for sub-categories\' PRIMARY KEY (`category_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; Simply, how can get

Warning: Attempt to present * on * whose view is not in the window hierarchy - swift

混江龙づ霸主 提交于 2019-11-26 10:20:27
问题 I\'m trying to present a ViewController if there is any saved data in the data model. But I get the following error: Warning: Attempt to present * on *whose view is not in the window hierarchy\" Relevant code: override func viewDidLoad() { super.viewDidLoad() loginButton.backgroundColor = UIColor.orangeColor() var request = NSFetchRequest(entityName: \"UserData\") request.returnsObjectsAsFaults = false var appDel:AppDelegate = (UIApplication.sharedApplication().delegate as AppDelegate) var

Is it possible to create a recursive query in Access?

纵然是瞬间 提交于 2019-11-26 09:45:31
问题 I have a job table Id ParentID jobName jobStatus The root ParentID is 0. Is it possible in Access to create a query to find a root for a given job ? The database is MDB with no linked tables. The Access version is 2003. A job can be several levels grand children deep. 回答1: No, It isn't. Recursive queries are supported in SQL Server after SServer 2005, but not in Access. If you know the number of levels beforehand, you could write a query, but it wouldn't be a recursive one. In SQL Server, CTE

iOS difference between isKindOfClass and isMemberOfClass

帅比萌擦擦* 提交于 2019-11-26 09:05:50
问题 What is the difference between the isKindOfClass:(Class)aClass and the isMemberOfClass:(Class)aClass functions? I know it is something small like, one is global while the other is an exact class match but I need someone to specify which is which please. In Swift isKind(of aClass: AnyClass) and isMember(of aClass: AnyClass) . 回答1: isKindOfClass: returns YES if the receiver is an instance of the specified class or an instance of any class that inherits from the specified class. isMemberOfClass:

How to mix inheritance strategies with JPA annotations and Hibernate?

好久不见. 提交于 2019-11-26 06:36:42
问题 According to the Hibernate Reference Documentation it should be possible to mix different inheritance mapping strategies when using Hibernate\'s XML-Metadata: http://docs.jboss.org/hibernate/stable/core/reference/en/html/inheritance.html#inheritance-mixing-tableperclass-tablepersubclass However, the corresponding section of the Hibernate Annotations Reference Guide does not cover that: http://docs.jboss.org/hibernate/stable/annotations/reference/en/html/entity.html#d0e1168 On the other hand,