List with moving capability

I need to create a list that the user can move items up an down (prioritize). Anyone have any suggestions on how to do this? I have embedded view currently with the items in it but I dont think you can sort items like that in a view … or can you?

thanks for any help,

Mark

Subject: List with moving capability

Web or Notes? To do this, you could have an alias for each entry in the keyword list with a number based on its position in the list. Probably the easiest way to do it, is to have two fields in a control (profile) document. One set has the numbers and one does not. When you need to change the order of the fields (with a button or hotspot on the form to move an entry up or down, perhaps), you would update the number for the moving entry, and then update the other numbers around it and re-write the profile field, then refresh the field in the document from the profile document.

Having said all of that… you can do it in a view much easier, using a similar principle. Look on www.codestore.net for this Rough Cut and check out the demo and the Article as well

:

http://www.codestore.net/store.nsf/unid/BLOG-20060228?OpenDocument

Of course this demo is for the Web. In a client, you would do something similar using LS.

Subject: RE: List with moving capability

I like it but I am looking for client code. I don’t know anything about the web stuff.

Mark

Subject: RE: List with moving capability

It’s a little confusing, but I blogged about this a while ago: A Secret Ingredient: SNTT - Letting a user reorder documents from a listbox

If you need help respond here or on my blog.

Subject: RE: List with moving capability

Charles,That is very nice looking… I did something similar after a few hours of playing and came up with a simpler solution in script.

i build a list i put on temp field which is the formula for the list box. Then i use the array i create to manipulate.

up button

    Dim index As Long 

    Dim temp As String 

    

    'index of selected item 

    index = Arraygetindex(prioritylist, doc.Priority(0)) 

    

    If index = 0 Then 

            Messagebox "You cannot move the top item up" 

            Exit Sub 

    End If 

    

    'save the previous item 

    temp = prioritylist(index - 1) 

    

    'move it up 

    prioritylist(index -1) = prioritylist(index) 

    

    'move the saved one down 1 

    prioritylist(index) = temp 

    

    doc.TempPriority = prioritylist 

    

    Call uidoc.Refresh 

down arrow

    Dim index As Long 

    Dim temp As String 

    

    'index of selected item 

    index = Arraygetindex(prioritylist, doc.Priority(0)) 

    

    If index = Ubound(prioritylist) Then 

            Messagebox "You cannot move the bottom item down" 

            Exit Sub         

    End If 

    

    'save the previous item 

    temp = prioritylist(index + 1) 

    

    'move it up 

    prioritylist(index +1) = prioritylist(index) 

    

    'move the saved one down 1 

    prioritylist(index) = temp 

    

    doc.TempPriority = prioritylist 

    

    Call uidoc.Refresh