Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

MiniDateRangeItem criteriaField issue

$
0
0
Version 10.0p
Build 2015-06-23

Hiya,

Looks like there is an issue with MiniDateRangeItem criteriaField. When I use the MiniDateRangeItem on a search form:
Code:

        isc.SearchForm.create({
                ID : "DcFgSfSearchForm",
                autoDraw : false,
                submit : zizdc.fileGuideSearchFormSearch,
                canSubmit : true,
                saveOnEnter : true,
                action : "#",
                dataSource : dsFoo,
                fields : [
...
                {
                        name : "p_filedate_from",
                        _constructor : "MiniDateRangeItem",
                        criteriaField : "p_filedate"                       
                },
...

The generated criteria (DcFgSfSearchForm.getValuesAsCriteria()) looks like:
Code:


  "operator":"and",
  "_constructor":"AdvancedCriteria",
  "criteria":[ 
      { 
        "_constructor":"AdvancedCriteria",
        "operator":"and",
        "criteria":[ 
            { 
              "fieldName":"p_filedate_from",
              "operator":"greaterOrEqual",
              "value":{ 
                  "_constructor":"RelativeDate",
                  "value":"$yesterday",
                  "rangePosition":"start",
                  "logicalDate":true
              }
            }
        ]
      },
      { 
        "operator":"iContains",
        "fieldName":"s_name",
        "value":""
      }
  ]
}

which uses the name value instead of the criteriaField value.

It will do want I need if I hit it like this
Code:

...
                }, {
                        ID : "MINI_BREAK",
                        name : "p_filedate_from",
                        _constructor : "MiniDateRangeItem"
                }, {

...

        MINI_BREAK.rangeDialog.rangeItem.criteriaField = "p_filedate";

which gives me

Code:


  "operator":"and",
  "_constructor":"AdvancedCriteria",
  "criteria":[ 
      { 
        "_constructor":"AdvancedCriteria",
        "operator":"and",
        "criteria":[ 
            { 
              "fieldName":"p_filedate",
              "operator":"greaterOrEqual",
              "value":{ 
                  "_constructor":"RelativeDate",
                  "value":"-3d[-0D]",
                  "rangePosition":"start",
                  "logicalDate":true
              }
            }
        ]
      },
      { 
        "operator":"iContains",
        "fieldName":"s_name",
        "value":""
      }
  ]
}

which works as I expect. I have tried a whole bunch of things not to need that hack but haven't found anything else that worked. Any ideas?

Cheers,
Evan

Viewing all articles
Browse latest Browse all 4756

Trending Articles