Announcement

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

    12.0p: MiniDateRangeItem has problems with time and filtering

    Hi Isomorphic,

    please see the video of this modified testcase (v12.0p_2020-07-02).
    As you can see, after the item has stored the two datetimes (after selecting the 1st one twice, see ticket here), it forgets about the times (see the 12:00 in the popup and compare to the 23:59 in the "to"-field when selecting).

    Also, eventually the time-selection is no longer displayed in the DateItem for subsequent openings.
    Note that the problem here might be somehow related to nextShipment-field being of type="date" in the .ds.xml and not datetime (please also try it like that and modify the .ds.xml)

    For me, it also happened the same with datetime-fields where also the time is ignored. This is a problem, as then the entries from the whole last day are missing (00:00 vs 23:59).
    (this is what happened for me).
    Also the time selection disappears here (=for datetime-fields) for subsequent openings, too (last seconds of the video), which clearly is wrong.


    Click image for larger version

Name:	MiniDateRangeItem-time-problem.gif
Views:	191
Size:	925.1 KB
ID:	263033


    Best regards
    Blama


    Code:
    isc.ListGrid.create({
        ID:"dsListGrid", 
        width: "100%",
        height: "100%",
        autoFetchData: true,
        dataSource: "supplyItem",
        canEdit:true
    });
    isc.DynamicForm.create({
        ID: "dateForm",
        width: "100%",
        fixedColWidths: true,
        colWidths: [190, "*"],
        isGroup: true,
        dataSource: "supplyItem",
        groupTitle: "Date filter",
        fields : [
        {
            name: "nextShipment", title: "Mini Date Range", 
            editorType: "MiniDateRangeItem"
        },
        {
            name: "button", title: "Show filter criteria as object", 
            editorType: "ButtonItem",
            click: function (form, item) {
               isc.say(form.getValuesAsAdvancedCriteria() + '<br />' + form.getValuesAsAdvancedCriteria().operator)
            }
        },
        {
            name: "button2", title: "Show filter criteria readable",
            editorType: "ButtonItem",
            click: function (form, item) {
               isc.say(DataSource.getAdvancedCriteriaDescription(form.getValuesAsAdvancedCriteria(), supplyItem))
            }
        },
        {
            name: "button2", title: "Filter",
            editorType: "ButtonItem",
            click: function (form, item) {
               dsListGrid.filterData(form.getValuesAsAdvancedCriteria())
            }
        }
        ]
    });
    isc.VLayout.create({
        membersMargin: 10,
        members: [dsListGrid, dateForm],
        height: "100%",
        width: "100%",
    });

    #2
    Please retest this one in a build dated July 10 or later as well - and note that your MiniDateRangeItem field needs type:"datetime" if you want full time-filtering. The default is type:"date", and this will be properly enforced in the next build.

    Out of interest, if you want your first button to show the criteria-proper, wrap the call - isc.echoFull(form.getValuesAsAdvancedCriteria())

    Comment


      #3
      Hi Isomorphic,

      thanks, will retest.
      Also thanks for the hint on echoFull() - that's what I wanted to do. I looked up the docs directly, but it seems not to be doc'd, only echo(), echoAll(), echoLeaf() are in the object..isc docs. It's also missing in the SmartGWT SC docs.

      W.r.t. to the need of the type:"datetime" call I already asked here if it's really correct that I need this call - the underlying DataSource field is already of type datetime (in my case, not in the showcase).

      Best regards
      Blama

      Comment


        #4
        Hi Isomorphic,

        this is working for me now with v12.0p_2020-07-11. Please also note the report on echoFull() above.

        Thanks you & Best regards
        Blama

        Code:
        isc.ListGrid.create({
            ID:"dsListGrid", 
            width: "100%",
            height: "100%",
            autoFetchData: true,
            dataSource: "supplyItem",
            canEdit:true
        });
        isc.DynamicForm.create({
            ID: "dateForm",
            width: "100%",
            fixedColWidths: true,
            colWidths: [190, "*"],
            isGroup: true,
            dataSource: "supplyItem",
            groupTitle: "Date filter",
            fields : [
            {
                name: "nextShipment", title: "Mini Date Range",
                type: "datetime",
                allowRelativeDates: true,
                editorType: "MiniDateRangeItem"
            },
            {
                name: "button2", title: "Show filter criteria readable",
                editorType: "ButtonItem",
                click: function (form, item) {
                   isc.say(isc.echoFull(form.getValuesAsAdvancedCriteria(), supplyItem))
                }
            },
            {
                name: "button2", title: "Filter",
                editorType: "ButtonItem",
                click: function (form, item) {
                   dsListGrid.filterData(form.getValuesAsAdvancedCriteria())
                }
            }
            ]
        });
        isc.VLayout.create({
            membersMargin: 10,
            members: [dsListGrid, dateForm],
            height: "100%",
            width: "100%",
        });

        Comment


          #5
          Hi Isomorphic,

          actually, there is a small problem left with the code from #4. Please see this video, where it seems that the time portion is ignored, if it is the automatic 23:59 for the end date.
          It's OK if you select a time manually.

          Click image for larger version

Name:	MiniDateRangeItem-time-problem2.gif
Views:	77
Size:	552.8 KB
ID:	263066

          Best regards
          Blama

          Comment


            #6
            Hi Isomorphic

            this happens the same way for DateRangeItem (without "Mini").
            I think the problem is that RelativeDates don't support time - it's always nulled.
            If you click the calendar icon of a DateRangeItem / MiniDateRangeItem with a relative date and then select a time, the value of the item changes from RelativeDate (with nulled time) to normal date.

            Best regards
            Blama

            Comment


              #7
              The problem here is just a mismatch of types - you are assigning type:"datetime" to a formItem which is databound to a DS field with type:"date".

              If you create a clientOnly DS with a date field and a datetime field and bind to that, you should see both fields working as expected, without specifying type on the formItems.

              Comment

              Working...
              X