Skip to content Skip to sidebar Skip to footer

Optimized Table Shuffle

4 Comments

  • Harjo Kompagnie
    Posted December 23, 2013 at 8:28 pm

    Hi Gary,

    great tutorial, as always! 😉
    I do not quite understand where those icons come from: scopes.enums.icon_shuffleGrey?

    we have a similar approach, but the trouble starts, when you doing this inside a (Servoy) transaction: databaseManager.autoSave = false.

    than you can’t use fs.sort() because that will do a save!
    So you have to use a foundset in-memory sort!

    And while doing that, in web-client this will give painting issues:

    Look here: https://support.servoy.com/browse/SVY-5627 (point 2)

    • Post Author
      Gary Dotzlaw
      Posted December 23, 2013 at 9:24 pm

      Thanks Harjo! I appreciate the kind words.

      The icon comes from my scopes.enums and is simply a variable that points to my media:
      var icon_shuffleGrey = 'points to the image media url'; (cant seem to put the actual url here)

      Yes, if you are doing database transactions, then it is more complicated because you cannot do a sort with unsaved records. I typically do not permit the user to sort rows in tables until they have saved the records (not in Edit mode). I show a nice dialog that informs the user they need to save the records first, and exit edit mode, before they can begin sorting records. Easy to explain records cannot be sorted until changes/new records are committed.

      I only work with the web client and have not run into any painting issues, so it must be related to the in memory sort you are doing.

  • Steve H
    Posted October 13, 2014 at 2:09 pm

    Hi Gary,

    Thanks for the great explanation above.

    I have one question (not having tried to implement this yet so it may be a dumb question!):

    When the user first clicks the record and the icons turn green and red, will this not cause a data broadcast and all other users viewing the same foundset get the effect of having their icons change as well?

    Thanks
    Steve

    • Post Author
      Gary Dotzlaw
      Posted October 20, 2014 at 1:28 pm

      Yes it would broadcast the color change to all other users as well. Most of my clients these days do not use the color change, and keep all icons gray. There are a few reasons for this; changing the icons takes time, and there is a performance hit to refresh the icons that is noticeable on larger lists; the color change is not really necessary for the shuffle function to work as the user can just click on the one to move and click on the destination.

      If you did want to use the color change in the icon with multiple users, then you have to tie the table view to a user specific record, that holds the icon colors for the data rows, similar to what we do these days with table view persistence using an object (restore the users column order, column size, sort). Honestly, not sure it is worth the performance hit just to do the icon colors.

Leave a Reply to Gary Dotzlaw Cancel reply

Dotzlaw © 2025. All Rights Reserved.