gizmomogwai / org-kanban

Kanban table for org-mode
MIT License
238 stars 18 forks source link

Group items together in each column #24

Closed namdnguyen closed 4 years ago

namdnguyen commented 4 years ago

Is there a way to sort TODO items together for each column, so that there are no gap rows in between items of the same column. Currently, the row a TODO item is given in the kanban table is based on its order in the file or the order of retrieval for multiple file scoping.

For example, I would like to re-sort and group items in the table from the first example below to become the second example:

#+BEGIN: kanban 
| TODO   | NEXT   | DONE   |
|--------+--------+--------|
|        |        | Item 1 |
|        |        | Item 2 |
|        | Item 3 |        |
| Item 4 |        |        |
|        |        | Item 5 |
| Item 6 |        |        |
#+END:
#+BEGIN: kanban 
| TODO   | NEXT   | DONE   |
|--------+--------+--------|
|        |        | Item 1 |
|        |        | Item 2 |
|        |        | Item 5 |
|        | Item 3 |        |
| Item 4 |        |        |
| Item 6 |        |        |
#+END:
gizmomogwai commented 4 years ago

Thats another great idea, I think it should be possible!

namdnguyen commented 4 years ago

I tried it out and worked great for me! I don't use priority in org-mode, but I was curious whether it would be possible to sort by both priority and TODO state.

gizmomogwai commented 4 years ago

Thats good news. Your idea is actually great!!! I will have to adjust the code a little bit, but then it should be quite easy to combine the compare functions together. The only problem might be, that the format will change. At the moment you can use one of <,>,s,S but then it would be something like S<P< or S

to say that sorting should be done first on state and then on priority or something like that :)

namdnguyen commented 4 years ago

Awesome! The package has been great. It's the fastest and most customizable of the options I've used.