Announcement

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

    RadioGroupItem: Different behavior on FF and IE.

    Hi,

    We observe a different RadioGroupItem behavior on FF and IE. On FF, the item with the negative key will be put before items with positive keys, which is a desired behavior for us. However, on IE the item with the negative key will be put after items with positive keys.

    We are using SmartClient_v83p_2013-06-11_PowerEdition on FF12 and IE9.

    Please check the following code:

    The "-1" item is displayed as the first item on FF but the last item on IE. We want the behavior on FF. Can you please advise? Thanks!

    Code:
    isc.DynamicForm.create({
        width: 500,
        numCols: 4,
        fields: [
            {
             title: "Date",
             type: "RadioGroupItem",
             valueMap: {"-1":"Yesterday", "0":"Today","1":"Tomorrow"},
                 vertical: false
            }
        ]
    });

    #2
    This is because IE9 and Chrome have introduced a behavior where for..in iteration over a JavaScript object, the order of iteration over properties no longer follows the order of declaration, but *only* for properties that happen to be parsable as positive integers.

    Yes, this is very surprising and inconsistent. We were very vocal in protesting against this change.

    The easiest workaround is to introduce any other character into the property name. A trailing space (like "0 ") would work, for example.

    This may require some additional parsing logic to trim off the trailing space at a later stage, but this is the least bad of all of the workarounds for this bizarre browser behavior.

    Comment


      #3
      Thanks for the solution! We may try to avoid using negative numbers in the future.

      Comment

      Working...
      X