atk4 / ui

Robust and easy to use PHP Framework for Web Apps
https://atk4-ui.readthedocs.io
MIT License
446 stars 106 forks source link

When you create new record in CRUD it should be placed as first always #526

Open DarkSide666 opened 6 years ago

DarkSide666 commented 6 years ago

Currently when you create new record in CRUD it goes to the end of list. With default sorting and multiple pages in paginator it becomes invisible record and that's very very bad for usability.

Solution:

  1. fix #524
  2. newly created record should always show up as first row (in current paginator page?).

Not sure if that's best way to do that, but anyway requirement is - when user creates new record in CRUD he should instantly see it on screen and maybe even have some visual feedback that this record is new. For example, play with rows css background color or something like that.

romaninsh commented 6 years ago

ATK in many cases works "minimum" configuration. in MySQL items are not ordered by default. In ATK model records are not ordered by default.

To change behaviour is to introduce artificial and non-natural order. ATK developers will ask how to disable this.

Possibly one solution is to locate which page has the new item and open that particular page, but that is quite complex and I'm not sure how to do that elegantly.

DarkSide666 commented 6 years ago

Why closing? I guess by mistake.

It's legit UX issue and I received such question from one of our clients. And he is not first one who asked that. I had multiple requests like this when I was developing in old ATK 4.x. At that time I told them that this is limitation of toolkit, but ... limitations are always bad :)

Maybe you could ask @mayack for some help with this? How other software are doing this?

romaninsh commented 6 years ago

one way to solve that is to introduce "render row" functionality, which could be sending row data after editing record and when adding a new record. I value simplicity of ATK crud and I do not mind if there is another implementation which solves the issues listed, but i feel it's place is inside the add-on.