Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Sort does not work correctly when using formatCellValue

    SmartClient: v9.1p_2014-04-10 (our current version)
    SmartClient: v10.0p_2015-06-23

    Browser: Chrome


    We use the grid to generate some dynamic columns based on other data in the grid. For this purpose, we define the formatCellValue function for the applicable fields. I have simplified the use case below, omitting our business logic for clarity. Sorry for the large amount of test data, this seems to happen with large data sets.

    1. Load the test case
    2. Sort the Region column
    3. Scroll through results
    4. Observe that the sort is not correct
    5. Reload the page
    6. Scroll though the grid from top to bottom so all records are drawn, then back to the top
    7. Sort the Region column
    8. Note that the sort is now correct

    Seems like when the records are scrolled through, the formatCellValue function is called, and the field is then assigned a value (since this is a derived column it does not have a value to start with - we set it in the formatCellValue function).



    Code:
    <!DOCTYPE html>
    
    <html>
        <head>
    
            <title></title>
            
            <style>
                .diagInfo {
                    font-size: 14px;
                    font-weight: bold;
                    padding: 5px;
                }
            </style>
            
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/modules/ISC_Core.js"></script>
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/modules/ISC_Foundation.js"></script>
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/modules/ISC_Containers.js"></script>
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/modules/ISC_Grids.js"></script>
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/modules/ISC_Forms.js"></script>
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/modules/ISC_DataBinding.js"></script>
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/modules/ISC_Drawing.js"></script>
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/modules/ISC_PluginBridges.js"></script>
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/modules/ISC_Charts.js"></script>    
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/skins/EnterpriseBlue/load_skin.js"></script>
        
            <script type="text/javascript" >
                var isomorphicDir="http://localhost:8080/isomorphic/";
                
                // set this to the correct JIRA ticket
                var JIRA_TICKET = "SNQA-1023";
                
    
                // test data
                var data = [
                { project: "123 Avenue", path:"Central",  owner: "University of MD", ins: 33, obs: 231, unsafe: 9 },
                { project: "Long Project Name", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "6789 Avenue B", path:"East", owner: "University of MD", ins: 33, obs: 23, unsafe: 9    },
                { project: "123 Avenue", path:"South", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Feliz Navidad", path:"East", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Whitehouse Lawn Maintenance", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"East",  owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "Automated Teller MAchine Upgrades", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"Central", owner: "University of MD", ins: 33, obs: 34, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Saks Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"Central",  owner: "University of MD", ins: 33, obs: 231, unsafe: 9     },
                { project: "Long Project Name", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "6789 Avenue B", path:"East", owner: "University of MD", ins: 33, obs: 23, unsafe: 9    },
                { project: "123 Avenue", path:"South", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Feliz Navidad", path:"East", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Whitehouse Lawn Maintenance", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"East",  owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "Automated Teller MAchine Upgrades", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"Central", owner: "University of MD", ins: 33, obs: 34, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Saks Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"Central",  owner: "University of MD", ins: 33, obs: 231, unsafe: 9     },
                { project: "Long Project Name", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "6789 Avenue B", path:"East", owner: "University of MD", ins: 33, obs: 23, unsafe: 9    },
                { project: "123 Avenue", path:"South", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Feliz Navidad", path:"East", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Whitehouse Lawn Maintenance", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"East",  owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "Automated Teller MAchine Upgrades", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"Central", owner: "University of MD", ins: 33, obs: 34, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Saks Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"Central",  owner: "University of MD", ins: 33, obs: 231, unsafe: 9     },
                { project: "Long Project Name", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "6789 Avenue B", path:"East", owner: "University of MD", ins: 33, obs: 23, unsafe: 9    },
                { project: "123 Avenue", path:"South", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Feliz Navidad", path:"East", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Whitehouse Lawn Maintenance", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"East",  owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "Automated Teller MAchine Upgrades", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"Central", owner: "University of MD", ins: 33, obs: 34, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Saks Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"Central",  owner: "University of MD", ins: 33, obs: 231, unsafe: 9     },
                { project: "Long Project Name", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Whitehouse Lawn Maintenance", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"East",  owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "Automated Teller MAchine Upgrades", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"Central", owner: "University of MD", ins: 33, obs: 34, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Saks Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"Central",  owner: "University of MD", ins: 33, obs: 231, unsafe: 9     },
                { project: "Long Project Name", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Whitehouse Lawn Maintenance", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"East",  owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "Automated Teller MAchine Upgrades", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"Central", owner: "University of MD", ins: 33, obs: 34, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Saks Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"Central",  owner: "University of MD", ins: 33, obs: 231, unsafe: 9     },
                { project: "Long Project Name", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Whitehouse Lawn Maintenance", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"East",  owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "Automated Teller MAchine Upgrades", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"Central", owner: "University of MD", ins: 33, obs: 34, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Saks Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"Central",  owner: "University of MD", ins: 33, obs: 231, unsafe: 9     },
                { project: "Long Project Name", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Whitehouse Lawn Maintenance", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"East",  owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "Automated Teller MAchine Upgrades", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"Central", owner: "University of MD", ins: 33, obs: 34, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Saks Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"Central",  owner: "University of MD", ins: 33, obs: 231, unsafe: 9     },
                { project: "Long Project Name", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Whitehouse Lawn Maintenance", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"East",  owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "Automated Teller MAchine Upgrades", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"Central", owner: "University of MD", ins: 33, obs: 34, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Saks Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"Central",  owner: "University of MD", ins: 33, obs: 231, unsafe: 9     },
                { project: "Long Project Name", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Whitehouse Lawn Maintenance", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"East",  owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "Automated Teller MAchine Upgrades", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"Central", owner: "University of MD", ins: 33, obs: 34, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Saks Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"Central",  owner: "University of MD", ins: 33, obs: 231, unsafe: 9     },
                { project: "Long Project Name", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Whitehouse Lawn Maintenance", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"East",  owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "Automated Teller MAchine Upgrades", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"Central", owner: "University of MD", ins: 33, obs: 34, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Saks Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"Central",  owner: "University of MD", ins: 33, obs: 231, unsafe: 9     },
                { project: "Long Project Name", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Whitehouse Lawn Maintenance", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"East",  owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "Automated Teller MAchine Upgrades", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"Central", owner: "University of MD", ins: 33, obs: 34, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Saks Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"Central",  owner: "University of MD", ins: 33, obs: 231, unsafe: 9     },
                { project: "Long Project Name", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Whitehouse Lawn Maintenance", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"East",  owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "Automated Teller MAchine Upgrades", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"Central", owner: "University of MD", ins: 33, obs: 34, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Saks Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"Central",  owner: "University of MD", ins: 33, obs: 231, unsafe: 9     },
                { project: "Long Project Name", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Whitehouse Lawn Maintenance", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"East",  owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "Automated Teller MAchine Upgrades", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"Central", owner: "University of MD", ins: 33, obs: 34, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Saks Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"Central",  owner: "University of MD", ins: 33, obs: 231, unsafe: 9     },
                { project: "Long Project Name", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Whitehouse Lawn Maintenance", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"East",  owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "Automated Teller MAchine Upgrades", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"Central", owner: "University of MD", ins: 33, obs: 34, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Saks Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"Central",  owner: "University of MD", ins: 33, obs: 231, unsafe: 9     },
                { project: "Long Project Name", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Whitehouse Lawn Maintenance", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"East",  owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "Automated Teller MAchine Upgrades", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"Central", owner: "University of MD", ins: 33, obs: 34, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Saks Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"Central",  owner: "University of MD", ins: 33, obs: 231, unsafe: 9     },
                { project: "Long Project Name", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Whitehouse Lawn Maintenance", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"East",  owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "Automated Teller MAchine Upgrades", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"Central", owner: "University of MD", ins: 33, obs: 34, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Saks Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"Central",  owner: "University of MD", ins: 33, obs: 231, unsafe: 9     },
                { project: "Long Project Name", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "6789 Avenue B", path:"East", owner: "University of MD", ins: 33, obs: 23, unsafe: 9    },
                { project: "123 Avenue", path:"South", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Feliz Navidad", path:"East", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Whitehouse Lawn Maintenance", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"East",  owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "Automated Teller MAchine Upgrades", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"Central", owner: "University of MD", ins: 33, obs: 34, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Saks Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"Central",  owner: "University of MD", ins: 33, obs: 231, unsafe: 9     },
                { project: "Long Project Name", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "6789 Avenue B", path:"East", owner: "University of MD", ins: 33, obs: 23, unsafe: 9    },
                { project: "123 Avenue", path:"South", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Feliz Navidad", path:"East", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Whitehouse Lawn Maintenance", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"East",  owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "Automated Teller MAchine Upgrades", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"Central", owner: "University of MD", ins: 33, obs: 34, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Saks Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"Central",  owner: "University of MD", ins: 33, obs: 231, unsafe: 9     },
                { project: "Long Project Name", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "6789 Avenue B", path:"East", owner: "University of MD", ins: 33, obs: 23, unsafe: 9    },
                { project: "123 Avenue", path:"South", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Feliz Navidad", path:"East", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Whitehouse Lawn Maintenance", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"East",  owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "Automated Teller MAchine Upgrades", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"Central", owner: "University of MD", ins: 33, obs: 34, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Saks Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"Central",  owner: "University of MD", ins: 33, obs: 231, unsafe: 9     },
                { project: "Long Project Name", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "6789 Avenue B", path:"East", owner: "University of MD", ins: 33, obs: 23, unsafe: 9    },
                { project: "123 Avenue", path:"South", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Feliz Navidad", path:"East", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Whitehouse Lawn Maintenance", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"East",  owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "Automated Teller MAchine Upgrades", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"Central", owner: "University of MD", ins: 33, obs: 34, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Saks Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"Central",  owner: "University of MD", ins: 33, obs: 231, unsafe: 9     },
                { project: "Long Project Name", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "6789 Avenue B", path:"East", owner: "University of MD", ins: 33, obs: 23, unsafe: 9    },
                { project: "123 Avenue", path:"South", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Feliz Navidad", path:"East", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Whitehouse Lawn Maintenance", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"East",  owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "Automated Teller MAchine Upgrades", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"Central", owner: "University of MD", ins: 33, obs: 34, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Saks Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"Central",  owner: "University of MD", ins: 33, obs: 231, unsafe: 9     },
                { project: "Long Project Name", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "6789 Avenue B", path:"East", owner: "University of MD", ins: 33, obs: 23, unsafe: 9    },
                { project: "123 Avenue", path:"South", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Feliz Navidad", path:"East", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Whitehouse Lawn Maintenance", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"East",  owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "Automated Teller MAchine Upgrades", path:"East", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "123 Avenue", path:"Central", owner: "University of MD", ins: 33, obs: 34, unsafe: 9    },
                { project: "123 Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    },
                { project: "123 Avenue", path:"North", owner: "University of MD", ins: 33, obs: 231, unsafe: 9    },
                { project: "Saks Avenue", path:"West", owner: "University of MD", ins: 33, obs: 1, unsafe: 9    }
            ];
            
            var formatFnx = function(value, record, rowNum, colNum, grid) {
                    var str = record["path"] + " region"
                    record["test"] = str;
                    return str;
                }
                            
                isc.DataSource.create({
                ID: "ds",
                fields: [
                    {name:"project", title:"Project", type:"text" },
                    {name:"test", title:"Region", type:"text", formatCellValue: formatFnx }
                                
                
                    
                ],
                cacheData:data,
                clientOnly: true
            });
                
                // once page loads set some diagnostic information, DO NOT CHANGE
                isc.Page.setEvent("load", function() {
                    document.title = JIRA_TICKET + "   (SmartClient version " + isc.versionNumber + ")";
                    var html = [];
                    html.push("Jira: " + JIRA_TICKET);
                    html.push("SmartClient: " + isc.versionNumber);
                    html.push("Browser: " + navigator.appCodeName + " " + navigator.appName + " " + navigator.appVersion);
                    diagLabel.setContents( html.join("<br>"));
                    
                    
                });
                
                
            </script>
    
        </head>
        
        <body>
            <script>
            
                // ===== DO NOT REMOVE =====
                var diagLabel = isc.Label.create({
                            ID: "diagInfo",
                            width: "100%",
                            styleName: "diagInfo",
                            autoFit: true
                        });
                // ===== DO NOT REMOVE =====
                            
                // basic grid        
                var grid = isc.ListGrid.create({
                    dataSource: ds,
                    dataFetchMode : "local",
                    autoFetchData: true,
                    clientOnly: true,
                    position: "relative",
                    width : "100%",
                    align : "center",
                    autoFitData : "vertical",
                    autoFitMaxHeight : 400,
                    alternateRecordStyles : true,
                    canAddFormulaFields : true,
                    canAddSummaryFields : true,
                    canGroupBy : true,
                    canReorderFields : true,
                    showGroupSummary : true,
                    useAdvancedFieldPicker: true,
                    advancedFieldPickerThreshold: 5,
                    autoDraw: false,
                    badFormulaResultValue: "NA"
                });    
                
            
        
                // the main page layout - place all other components afetr diagLabel
                var layout = isc.VLayout.create({
                    width:"100%",
                    membersMargin: 20,
                    members: [
                        // ===== DO NOT REMOVE diagLabel
                        diagLabel,
                        // ===== place anty components here
                        grid
                    ]
                });
            
                    
            </script>
    
        </body>
    
    </html>

    #2
    formatCellValue is not a valid API to set on DataSourceField (see docs).

    Even if set on a ListGridField, formatCellValue() is not an appropriate place to calculate a value that you want to use for sorting - as you've seen, it is only run *after* sorting has been performed (and this is correct behavior). As the name implies, formatCellValue is for formatting an existing value, not calculating a new value.

    Two options:

    1. instead of creating a separate "test" field, just declare a field for the existing "path" value in the data set, and install the formatCellValue() function there. This way the field already has a value before formatCellValue is run, which will sort correctly

    2. calculate the value in DataSource.transformResponse(), so it is already there by the time any component (not just ListGrid) receives the data.

    Comment

    Working...
    X