Re: CUSTOM ORDERING IDEA
Re: CUSTOM ORDERING IDEA
- Subject: Re: CUSTOM ORDERING IDEA
- From: Pierre Bernard <email@hidden>
- Date: Thu, 27 Apr 2006 16:40:09 +0200
OK, I am going to throw a bit of SQL at the list:
update MY_TABLE set ORDER = (1 + ORDER) where ORDER > $current;
Shifts all rows above by one.
Blows the EOF cache.
Pierre
On Apr 27, 2006, at 4:01 PM, Jerry W. Walker wrote:
Hi, Amedeo,
On Apr 27, 2006, at 9:34 AM, Amedeo Mantica wrote:
Hello friends!
does anyone have an idea how to implement a custom row ordering in
a database?
My customers want to custom order row in database
i can create an ordering column with a double type (number) so i
can always move a row between two others...
Actually I don't know how to graphically impement this (user
interface)
do you have ideas? or other methods?
Unless your customers are going directly to the database, I don't
see why they would care (or even how they would notice) whether the
rows in a table were custom ordered. If they are going directly to
the database, either through SQL or through some database SQL GUI,
then the graphical interface ceases to be your problem. Simply
provide them with an ordering column.
However, if their only access to the database is through your
application, then row ordering in the database is irrelevant.
Simply maintain an ordering column (as you described above) and
always sort the EOs from that table on the ordering column before
you display them.
Allowing your users to reorder the rows can go from the simple:
such as giving them access to the ordering column's values; to the
complex: such as providing arrows, typically pointing up and down,
to move the selected item in a list one up or one down
respectively, and set the ordering column values yourself accordingly.
If you go with the latter route, it tends to be helpful to the
users to also add something like double headed arrows pointing up
and pointing down to move the selected item in the list to the
first or last value of the list respectively, and again setting the
ordering column values yourself.
If you're setting the values yourself, you're probably better off
using sequential integer values and simply changing the appropriate
ones when the order changes. Trying to maintain sparse values so a
row can always fit between two others can prove to be more trouble
than it's worth if the user does a lot of reordering.
Regards,
Jerry
--
__ Jerry W. Walker,
WebObjects Developer/Instructor for High Performance Industrial
Strength Internet Enabled Systems
email@hidden
203 278-4085 office
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden