Announcement

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

    Chrome sorting problem

    Hi there,

    I see a few threads out there discussing a problem with Google Chrome not sorting value maps correctly like this one:

    http://forums.smartclient.com/showthread.php?t=12428&highlight=chrome+sorting

    http://forums.smartclient.com/showthread.php?t=13613&highlight=chrome+sorting

    http://forums.smartclient.com/showthread.php?t=18819&highlight=chrome+sorting


    We are seeing this issue as well. Is this a known and documented issue that is being addressed? Any ETA for a fix?

    #2
    Unfortunately Chrome has fundamentally broken JavaScript Objects with this change in behavior, making it impossible to use an Object literal as a valueMap, since the browser simply drops the ordering information. The workaround is to use an optionDataSource if ordering is important and numeric keys are allowed.

    We have lobbied for order preservation to become an official part of the next JavaScript/ECMAScript standard.

    Comment


      #3
      Hi, is there any other javascript fix available for this problem other than using optionDataSource while we wait to see if the standards are revised?

      Comment


        #4
        Not really. In Chrome, Object is not order-preserving for numeric keys so theres not really a data structure that can preserve order that's simpler than the list of Records that an optionDataSource uses.
        Last edited by Isomorphic; 21 Feb 2012, 10:25.

        Comment


          #5
          Because we were now seeing this same sorting problem in IE9, we elected to go with the more elaborate hack of constructing our valuemap keys to include the value and the key. As a result of including the value in the key, the values now sort correctly. It required a lot of changes including the modification of the key to revert back to just the numeric value in transformRequest. But, it seemed like this issue wasn't going anywhere so we felt like we needed to resolve it on our own.

          Comment

          Working...
          X