Announcement

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

    Numbers are being reported as strings in new ListGrid records

    Hi,

    We are seeing numbers getting reported as Strings for new ListGrid records. We can add explicit conversion on our side. But, this was messing up some number formatting so thought you should know about it.


    You can recreate by going here:
    http://www.smartclient.com/#enterNewRows

    Then, add this editorExit property to the population field and click Try it. Click Enter New Row. Enter a numeric value for Population and then try to click on a different grid row. You'll get an alert showing population is a string and not a number?

    Code:
    editorExit:function(editCompletionEvent, record, newValue, rowNum, colNum){  alert(typeof countryList.getEditValue(15,"population"));},

    #2
    At editorExit, attempted save has not yet occurred, so the value is unvalidated and hence still a String.

    Comment


      #3
      Ok, I guess I gave a bad example. Try this instead.

      Change formatCellValue to this:

      Code:
               formatCellValue:"if(typeof countryList.getEditValue(15,'population')=='string'){return 'string'}else{return 'number'}"},
      If you add a new row and click away in the 8.0 Feature Explorer, you get a value of string in the new row.

      If you try the same thing in the 6.5.1 feature explorer here:
      http://www.smartclient.com/docs/6.5.1/a/system/reference/SmartClient_Explorer.html#enterNewRows

      Then, you get a value of number in the new row.

      So, that is where the difference is that we noticed during our testing. Is that by design? Or, is that a bug with 8.0?

      Comment


        #4
        Thanks for the test case - we've added a fix for this - should be resolved in the next nightly build.

        Comment

        Working...
        X