Announcement

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

    splitCriteria warning with advanced criteria


    SmartClient Version: v11.1p_2019-10-25/AllModules Development Only (built 2019-10-25)

    Chrome on OSX

    Hello, please modify the fetchOperationFS, by just adding showFilterEditor:
    Code:
    isc.ListGrid.create({
        ID:"dsListGrid", 
        width: "100%",
        height: "100%",
        autoFetchData: true,
        dataSource: "supplyItem",
    showFilterEditor:true 
    });
    Then set a filter like units:'roll' and a date range for nextShipment.

    then execute this code:
    Code:
    var criteria = isc.DataSource.copyCriteria(dsListGrid.getFilterEditorCriteria())
    supplyItem.splitCriteria(criteriaFoo, ["units"])
    you'll get an empty criteria and a warning:

    Code:
    *18:51:41.009:WARN:Log:splitCriteria: advanced criteria second-level operator, and, not supported.
    is it expected? If yes, which type of AdvancedCriteria is supported? It seems pretty basic and 'flat'.

    #2
    Yes, this is expected, and the docs cover this. There is no way to represent a date range filter as simple criteria, and that's what splitCriteria() returns.

    You should create your own helper method if you need to split an AdvancedCriteria and end up with two AdvancedCriteria.

    Comment


      #3
      Thanks for the heads up!

      My actual use case was a bit different, but actually there was a criterion with a 'iContains' operator, and I think it's the problem.
      It's an advanced criteria like that:

      Code:
      {
          "operator":"and", 
          "_constructor":"AdvancedCriteria", 
          "criteria":[
              {
                  "operator":"equals", 
                  "fieldName":"ID_STAGIONI_FK", 
                  "value":4485361
              }, 
              {
                  "fieldName":"IS_ABBONAMENTO_LEGENDS", 
                  "operator":"iContains", 
                  "value":"T"
              }, 
              {
                  "fieldName":"ID_EVENTO_FK", 
                  "operator":"equals", 
                  "value":6944684
              }
          ]
      }
      Only the warning message is a bit misleading, as it mention the operator 'and', but the actual problem is the operator iContains.

      Comment

      Working...
      X