At 10:15 pm -0700 15/7/01, Richard Gaskin wrote:
>I've been working on yet another multi-column list solution for displaying
>database output.  I'd love to use MC's built-in support, but I can't
>guarantee the data will fit into a fixed-width column, and the MC field
>object does not yet support clipping, instead pushing subsequent columns
>over.
>
>So my current favorite strategy is to use multiple list fields, but this is
>not without its share of issues:
>
>- Selection is always funky, since you have to grab the line the user
>   clicked on in one field and apply that to all the others.
For this, I use a "dummy" field that sits behind the "data" fields. 
This field is filled with returns and is the one that is hilited when 
a user clicks on one of the "data" fields. I've found this looks 
better than hiliting lines in adjacent fields.

>- Dragging below the field boundary to scroll all the fields in
>   unison is wonky in my best  effort (maybe one of you has a good
>   recipe for that?).

>- Sorting is a bear, since you effectively need to reassemble the
>   various fields into a single chunck, sort by item, and put them
>   all back (or something even more complicated).
I keep all the data in a single property. In this way, I only have to 
worry about "putting the data back". It adds a memory penalty, but 
it's worth it for ease of use and speed. Operations such as sorting, 
deleting lines, etc. can be performed on the always available single 
chunk. I make use of setprop and getprop handlers for this which can 
make scripting in handlers that manipulate the displayed data easier 
to write. For example, a cData property can be used to both set and 
display the data. Something like:

setprop cData pData
  set the cData of me to pData
  # next have the routines
  # that display the data in the columns
end cData

Then when you want to manipulate the data, it can be done easily.

get the cData of group "myList"
sort lines of it by item 2 of each
set the cData of group "myList" to it

Cheers
Dave Cragg





Archives: http://www.mail-archive.com/[email protected]/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to