search 
there is always room for another creative voice
blog archivesrss feed
 
sorting documents via InViewEdit
Thursday, March 9th, 2006 :: by jonvon
i do lots of development in the Notes client. i needed an easy way to sort docs on the fly, and decided to try the InViewEdit event available as of Notes 6.

for show 'n tell thursday i thought i'd let the code out of the bag. i just recently reworked this code to allow for multiple categories. my first version of this code was only good for flat views and views that had one category.

i'm not 100% sure this code is bug-free, although it seems to be working pretty well in testing so far. and i'm not real sure also how scalable it is. it might kinda break down some if the view is really huge. but with small views, it seems to work fine.

i'm posting it hoping for community review as much as to be a help to anyone trying to do this. so if you find bugs or have suggestions on a better way to do this, by all means let me know. thanks.

without further ado, here is the code:

DocSorter

you will also need the StringParser code to follow my implementation, although you don't really have to have this. you might have your own code that handles converting strings to ints, or whatever.

here is a partial screenshot from an app i'm working on:



i make the values in the editable column a bright blue color to indicate that the column can be edited.

p.s. forgot to mention, there is some code in there that will help you to implement this correctly. with any luck, if you input the name of a field incorrectly or something, the code will let you know when you try to use it via a message box, or via an email if you run it on the server.
discussion thread
[ no comments yet... ]
add a comment
subject
name
email
web site
comments
remember me?    
 
about this sitecontactsite license