I'm about to write a subclass of the UI controller for an entity that needs a draggable table on its admin page to order & place the entities in a hierarchy -- much like taxonomy terms.

It occurs to me that this could be made generic and available as a subclass in Entity API module.

If you're interested, I can write this as a patch for Entity API :)

Comments

joachim’s picture

Here's how I reckon this could work:

- In the entity info 'entity keys', add 'weight' and 'parent' items.
- In the entity info 'admin ui' section, add:
- 'draggable' => TRUE
- 'hierarchy' => TRUE

Thus modules like profile2 could use just the 'draggable' part.

rerooting’s picture

Ooh I like I like. I'll see how I can help!

Our good friends at the examples module might provide some inspiration...

http://drupalcode.org/project/examples.git/tree/refs/heads/7.x-1.x:/tabl...

Another interesting thing to note is that the weight item could be used for a generic tablesort ability as well. They might just be 'draggable' => TRUE; 'hierarchy' => FALSE (Though the proper lingo might be something more like 'sortable' => TRUE)?

joachim’s picture

BruceDawson’s picture

Issue summary: View changes

Would it be possible to make fields "inheritable" to children?