Announcement

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

    [13.0p] ParseEditorValue in Grids not working correct

    HI there,
    Wit the current build there is an error in the parseEditorValue.
    Entering a Value like "1620" and then tab out does call the parseEditorValue-Method with a value "1620" and afterwards 2 more times with "16: 20" with a space after the colon!
    Entering a value like "1745" and then hit enter, the method will be called three times with the same value "1745".

    In both cases, there is a space after the colon. This should be there.
    In our use case we have implemented some convenience functions in the completeTimeFormat-Method, but the parameter should be the same.

    Its reproducable in the latest build (SmartClient_v130p_2023-07-26_Pro.zip) and all browsers



    Code:
    isc.TreeGrid.create({
        "ID": "theTreeGrid",
        "width": "400",
        "height": "200",
        "autoDraw": true,
        "canEdit": true,
        "autoSaveEdits": false,
        "timeFormatter": "toShort24HourTime",
        "fields":
        [{
                "name": "timeBeginDayTreeGridField",
                "title": "Tag",
                "type": "text",
                "width": 160,
                "canEdit": false,
                "escapeHTML": true,
                "shouldPrint": true,
                "editorProperties": {
                    "escapeHTML": true
                }
            }, {
                "name": "timeBeginTimeTreeGridField",
                "title": "Beginn Uhrzeit",
                "type": "time",
                "canEdit": true,
                "escapeHTML": true,
                "shouldPrint": true,
                "showHover": true,
                "editorProperties": {
                    "escapeHTML": true,
                    "parseEditorValue": function (value, form, item) {
                        return completeTimeFormat(value);
                    },
                    "ID": "editor1"
                }
            }, {
                "name": "workingTimeEndTimeTreeGridField",
                "title": "Ende Uhrzeit",
                "type": "time",
                "canEdit": true,
                "escapeHTML": true,
                "shouldPrint": true,
                "editorProperties": {
                    "escapeHTML": true,
                    "parseEditorValue": function (value, form, item) {
                        return completeTimeFormat(value);
                    },
                    "ID": "editor2"
                }
            }
        ],
        "nodeIcon ": null,
        "folderIcon": null,
        "selectionProperty": "isSelected",
        "leaveSelectionCheckboxGap": false,
        "members":
        [],
        data: isc.Tree.create({
            "ID": "timetree",
            "modelType": "children",
            "childrenProperty": "children",
            "openProperty": "isOpen",
            "root": {
                "title": "Root",
                "isFolder": false,
                "isOpen": false,
                "id": "root",
                "isSelected": false,
                "canSelect": true,
                "children":
                [{
                        "title": "",
                        "isFolder": false,
                        "isOpen": false,
                        "id": "2",
                        "canSelect": true,
                        "timeBeginDayTreeGridField": "Time",
                        "timeBeginTimeTreeGridField": "16:04",
                    }
                ]
            }
        })
    })
    function completeTimeFormat (timeInput) {
        console.log(timeInput);
        return timeInput
    }
    Best regards

    #2
    We're not seeing the unexpected space that you report when your test code is run with the exact patch build you mention. We also don't see the behavior you report with 1745 - for us, the second two calls show "17:45" like in the case of "16:20" for you. Are you able to reproduce your issue in our online Showcase? Do you have any browser addons, or other JavaScript frameworks installed alongside SmartClient? If so, please reattempt what you're saying is misbehaving without those addons or extra frameworks loaded.

    Note that the documentation for parseEditorValue() says that it receives the value being displayed as an input, so your parsing will have to deal wtih both user input (as typed), and the formatted time (however it ends up formatted as shown). So the fact that both variations (e.g. "1745" and "17:45") show up isn't necessasrily a bug. But, we don't see the extra space.

    You say it happens "in all browsers," but can you give a specific OS and browser for which you see it? We tried Chrome on both Windows 10 and Linux and it doesn't happen for us.

    Comment


      #3
      Hi,
      Thanks for the answer.


      You are right, that the parseEditorValue doesn't have anything to do with this bug! Also there are no extensions/addons included.
      I've retested this behaviour with an older release isomorphic-v13.0p_2023-04-01 Pro - here the bug was not present.


      At first I could not reproduce it with the online showcase. I assumed it was a change in the "toShort24HourTime" method.
      And indeed, with the inlcuded german language (locales/frameworkMessages_de.properties) the bug does come up.

      The default format for german 24-hour format shouldn't be "HH: MM" (with a space) but should be "HH:MM".
      It is defined in time_defaultTimeSeparator. Could you please change it back to the real german value? Maybe "locking" the translation would also be useful...

      Best regards

      Comment


        #4
        Thanks for the extra details - it appears that this is a result of misbehavior by our recently added AI translation mechanism.

        We'll dig into it and get back to you shortly when it's been addressed.

        Comment


          #5
          We've corrected various locales, for this property and a few number-formatting properties. Please retest with today's builds, dated August 7 or later.

          Comment

          Working...
          X