# ListView and Sorting



## gYab61zH (Aug 18, 2011)

John, I had a look at your ListView plug-in and wondered whether you had ever considered adding secondary (and possibly tertiary) sorting capabilities to it and linking it with the grid display, so that a ListView sort would be reflected in the grid. If you were to add the extended IPTC fields that would sort out my sorting problems (discussed in a different thread).

Are the sort of additions mentioned above doable?


----------



## johnbeardy (Aug 18, 2011)

AFAICS saving collections is the only way the SDK offers to change sort order in the gird, and even then the user has to select "user order". But in the next update, ListView will have an alternative close button which  adds the images to a new collection in the same order as the list. 

Beyond that, sorting by more columns would be difficult from a coding point of view, probably wouldn't work well lots of items, and would be more than the majority of people would ever need. When I want things like that, I just dump the data to Excel and take advantage of its unparalleled sorting, filtering and pivot table features.

As for the extended IPTC fields, they are in the plug-in, but remember their data are more like one-to-many records rather than fitting into a spreadsheet style grid. There is also a performance issue because the plug-in reads metadata as a batch, but that SDK feature doesn't include the extended fields. 

John


----------



## gYab61zH (Aug 18, 2011)

I hadn't realised sorting on multiple fields is so difficult. I used to do it in the now more or less defunct Paradox database engine all the time. I take it is easier to save a catalogue afresh than present link the sorted data back to existing SQL database (and hence the grid)?

Export to Excel doesn't really do it for me because it is the images that I need to see in a specific order, not the metadata (they are just a means to an end).

I had also not realised that extended IPTC fields are not the same as regular IPTC fields. Is this inherent in the fields or LR's implementation of them?

PS. I appreciate you taking the trouble to reply, especially since my needs are so clearly esoteric.


----------



## johnbeardy (Aug 18, 2011)

Oh, it's easy in a database! But plug- ins don't access the database directly - otherwise I would do that as I used to write a lot of SQL. Instead they use Lua code and access data through the SDK, and it's nowhere near as flexible as the VB that's behind iMatch. What's more, all the documentation is written by developers for developers and is therefore gobbledegook to an untrained programmer like me!

If you look at the extended IPTC fields, you'll find each photo can have multiple artworks, for example. That's very different to the old IPTC where - apart from keywords - each photo has one location field, one job code etc.

John


----------

