Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Ordering of foreign key data in drop downs 03 Dec 2015 16:36 #13719

  • Ferm
  • Ferm's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 39
  • Thank you received: 6
When I use a foreign key in a table, the records of the "foreign table" will be shown as drop downs in combo box filters in the list view and also in forms in the item view.

In both those situations, I can choose to use ajax loading or not. In my opinion, there are two problems:

1. The sorting is different. If I use the ordering wizard in the foreign table, the records will be shown as I order them with the ordering wizard only if I use ajax loading. If not, the records of the foreign table are always sorted alphabetically. So if my "foreign" table has the records A,B,C but he ordering is A,C,B, switching on ajax loading will give you A,C,B for the drop-down and without ajax it will be A,B,C
2. Small problem but in the item view, the design is different depending on whether I use ajax loading or not. For filters in the list view, it is always the same.

I would be really grateful if someone could help me figure out how to fix the ordering problem without using ajax loading. In my opinion, the problem is a rouge $this->addOrder() in the in the display function so it is possible to fork but you need to fork every view/layout combination.

Please Log in or Create an account to join the conversation.

Ordering of foreign key data in drop downs 07 Dec 2015 15:06 #13732

You can override the protected function prepareQuery(&$query) of the FK table.
Add an order there.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.072 seconds

  I found "cook" two days ago. Played around with it for a day and then within a day got rid of two legacy applications in IBM Lotus Domino Notes and replaced them with "cook". It was really easy. A piece of cake. Actually it was even easier than cooking. Cooking involves more work than developing with "cook". What can I say about "cook"? Great application great price for what it delivers great forum with a lot of information and fast responses active and friendly community fast forward moving development cycle So what should I say "Monsieur Le Cook"? Keep the good work going it will lead to success. Having become a paying member in the words of Edith Piaf may I say ..... non rien de rien ... je ne regrette rien. Vive La France.
FK (JED)
         

Get Started