Welcome, Guest
Username: Password: Remember me

TOPIC: How to Disable Sorting?

How to Disable Sorting? 09 Apr 2012 07:34 #1942

  • HNSingh
  • HNSingh's Avatar
  • Offline
  • New Member
  • Posts: 6
  • Karma: 0
I've built a simple module for work, very much like the one in the (enjoyable) tutorials but how do I turn OFF sorting?

I want the records to stay in the order they were entered.

Ideally, it would be helpful for the most recent record to always be at the top of the list with the older records being pushed down. This would save a bunch of scrolling down since we'll only be using the most recent 2 or 3 records.

Thank you!
The administrator has disabled public write access.

Re: How to Disable Sorting? 09 Apr 2012 10:43 #1943

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Uncheck it in the properties box.
Coding is now a piece of cake
The administrator has disabled public write access.

Re: How to Disable Sorting? 09 Apr 2012 18:18 #1954

  • HNSingh
  • HNSingh's Avatar
  • Offline
  • New Member
  • Posts: 6
  • Karma: 0
Thank you for the help.

The front end and the back end are automatically sorting on the field "My Name". I checked the property for "My Name" in the front and back Collections and the option "Sortable" is NOT ticked. Nor is it ticked for the other 7 fields.

I deleted my project and re-made it. The new project also automatically sorts on "My Name".

As a test, I ticked "Sortable" for "My Name" and the column name "My Name" becomes a clickable to sort ascending or descending.

Any ideas on how to stop each new record from being sorted? The front end and back end tables should have the records listed in the order they were entered.

For example, if I enter in this order: Peter, Andy, Wilhelm as records, the table should be (and the way I need it to be):
Wilhelm
Andy
Peter

But it shows up sorted as:
Andy
Peter
Wilhelm

Any suggestions?
The administrator has disabled public write access.

Re: How to Disable Sorting? 09 Apr 2012 18:48 #1955

  • HNSingh
  • HNSingh's Avatar
  • Offline
  • New Member
  • Posts: 6
  • Karma: 0
If I edit the persons name, they are sorted to a different position in the table. A BIG No-go.
Trying different users in the sandbox doesn't change this behavior.
The administrator has disabled public write access.

Re: How to Disable Sorting? 10 Apr 2012 08:32 #1958

  • giori
  • giori's Avatar
  • Offline
  • Senior Member
  • Posts: 73
  • Thank you received: 14
  • Karma: 6
You have to set a default sort order. Solution is here:
The administrator has disabled public write access.

Re: How to Disable Sorting? 11 Apr 2012 03:55 #1967

  • HNSingh
  • HNSingh's Avatar
  • Offline
  • New Member
  • Posts: 6
  • Karma: 0
Thank you Giori for the suggestion. I read through it but I don't see how to apply it to my really simple module.

All I want is to turn off automatic sorting. The last record added is either at the top or bottom of the list.

If automatic sorting can not be turned off, then it will have to sort on a web server date & time stamp.

It would actually be useful to have a field that is automatically filled in with the record's creation date & time.

BUT there is no "Date & Time" data type in Builder so how do I add an automatic D&T field?
Thanks!
The administrator has disabled public write access.

Re: How to Disable Sorting? 11 Apr 2012 05:09 #1968

  • HNSingh
  • HNSingh's Avatar
  • Offline
  • New Member
  • Posts: 6
  • Karma: 0
I just saw this current post about the lack of a Date & Time data type:

www.j-cook.pro/forum/12-new-functionalities/149-date-a-time

So maybe it is impossible to have an unsorted (or get the same end result by using sorted-by-date-&-time) table?
The administrator has disabled public write access.

Re: How to Disable Sorting? 11 Apr 2012 06:48 #1970

  • giori
  • giori's Avatar
  • Offline
  • Senior Member
  • Posts: 73
  • Thank you received: 14
  • Karma: 6
You need to use the "Creation Date Wizard" in your table. Then you get the creation date (or Modfication date if you use the "Modification Date Wizard"). With this and the "Order By" change recommended in the link mentioned above you can create what you want.
Unfortunately the Creation Date Wizard does not support date & time, which is quite a drawback. I do not understand why Jocelyn does not put more importance in adding this as it is a vital element of database management and has been requested many times. And it is standard in Joomla to have date and time in the same field.

In my case I created an intranet application where users have to write weekly reports, so it was enough to simply sort by creation date having the newest report record on top. So the time here was not relevant. But in most cases it is.
Last Edit: 11 Apr 2012 06:49 by giori.
The administrator has disabled public write access.
The following user(s) said Thank You: admin

Re: How to Disable Sorting? 11 Apr 2012 06:59 #1973

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Yes, you are right, I am sooo late on this.

I promise you to give move importance on this for next month.
Coding is now a piece of cake
The administrator has disabled public write access.

Re: How to Disable Sorting? 11 Apr 2012 08:51 #1974

  • giori
  • giori's Avatar
  • Offline
  • Senior Member
  • Posts: 73
  • Thank you received: 14
  • Karma: 6
Jocelyn,

great, and I also sympathize with you. In software development it always takes longer than one would expect to get something done. I see it in my own work. It is so difficult be be on time, as there are always minute details to care about.
The administrator has disabled public write access.
The following user(s) said Thank You: admin

Re: How to Disable Sorting? 11 Apr 2012 17:11 #1977

  • HNSingh
  • HNSingh's Avatar
  • Offline
  • New Member
  • Posts: 6
  • Karma: 0
Thank you giori, I'll implement your recommendation later today. I'm curious how the sorting will work with several records with the same date. Hopefully it defaults to sorting in the order they were added and not something unexpected like "Name"!

Can't wait to test...
The administrator has disabled public write access.
Time to create page: 0.075 seconds

Get Started