Click to See Complete Forum and Search --> : Image display order
portraitmaker
10-01-2003, 12:26 PM
I jave an ASP app that interfaces with an Access db and part of it displays thumbnail images sorted in a different order such as by Image Name , Title, etc.
We now have a need to be able to sort on a custom order. Rather than just having a display order field with a number of the order to be displayed I'd like to be able to have the thumbnails displayed in a window and then select an image and then be able to click on a placeholder or something between other images and move the selected image to that location. Then we would need to be able to save the new order in the database.
Has anyone seen some code that would do this or know of the best way to handle it?
Thanks,
Stephen
Ribeyed
10-01-2003, 04:10 PM
Hi,
this can be done at a database level. Don't know your database structure so wouldn't be able to come up with the new table/tables etc. without know your current structure. You will however need a seperate table which will store the order of the images along with the primary key of the table where the image names are stored. You would also need to store a unique identifer for who ever is doing the custom sort order. Once this is in place all you have to do is populate it then a few sql queries to retrieve order.
portraitmaker
10-01-2003, 04:36 PM
There is already a field for the sort order but currently we have to manually put in a number.
My concern is more with the actual mechanics of the custom sort screen. I've seen something similar done using javascript but haven't seen any code.
Ribeyed
10-01-2003, 05:15 PM
Hi,
obviously i miss understood your requirements. Can you describe further what a "sort on custom order" is?
Does the user customize the sort order?
Is the custom order the user has customized to be save for further use?
My understanding of the current system is:
"a user visits the page and a number is images are displayed. The order in which the images are displayed is determined by the user selecting options from a drop down box. Current the drop down box allows the user to select sort by; Images name, Title etc. "
My understanding of what you want to add is:
So you now want to add a new feature that is not a normal sort. You want to display all the images in a kind of random order then provide an interface where the user can select the images in the order in which the user wasn'ts them to be displayed. Once the user creates the custom order you need to store this order in the database for the user to reuse another time.
portraitmaker
10-01-2003, 10:18 PM
Maybe my terminology is what is confusing. By "sort on custom order" I meant to sort on a custom sequence rather than by name or size or something.
Your last statement is pretty much correct except an administrator rather than a visitor will be using this feature. The visitor will see the images in the sequence the admin has decided on.
The interface is what I'm looking for. I just want it to be easier for the admin to arrange the images in a certain sequence and have it automatically store this sort order ( sequence) rather than having to manually enter a number in a field to sort on.
Ribeyed
10-02-2003, 03:09 AM
hi,
ok so i was almost correct apart from the fact admin will customise the order not user and that there wil only be 1 customised order stored at anyone time.
Now i will make a suggestion no how i would handle this before i will write any code.
I would suggestion a dynamic form to start of with. This form will be displayed with 1 drop down menu with all the image names listed. The admin will select the first image they want to apear first in the custom sort order. Now either use a small bit of Javascript to automatically submit the form when an image is selected or provide a button to submit the form. Ok when i form is submitted you display the same page but this time with the first chose now displayed in text and a second drop down menu will apear which will allow admin to select the next image from the drop down list. The second drop down list will have all the images apart from the one selected first. This will continue until all the images have been selected in the correct order. After the last submit all you have to do is to process the form.
portraitmaker
10-02-2003, 01:01 PM
I think I understand what you are saying but it seems there would be a lot of mouse click with the drop down list and also clicking on the images.
Here is a screen shot of what I'm trying to duplicate.
http://www.portraitmaker.com/sort.jpg
What the image doesn't show you is when you do step 2 the window updates the image sequence so you can see the order before you save changes.