Announcement

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

    AdvancedCriteria --> SimpleCriteria

    Hi,

    I am using the filter on a ListGrid.

    In SC8, the "params" is more complicated than I need. Is there a way to make it just a simple params option like it was in version 6.5?

    See JSON request below triggered by the filter.

    I'd like params to just be the name/value pairs, without the operator/criteria additions.

    Thanks.

    Code:
    {
        "actionURL":"/gbs/data/restDS.php", 
        "showPrompt":true, 
        "prompt":"Finding records that match your criteria...", 
        "transport":"xmlHttpRequest", 
        "useSimpleHttp":true, 
        "promptStyle":"dialog", 
        "params":{
            "operator":"and", 
            "criteria":[
                {
                    "fieldName":"contract_name", 
                    "operator":"iContains", 
                    "value":"ABC"
                }
            ], 
            "isc_metaDataPrefix":"_", 
            "isc_dataFormat":"json"
        }, 
        "httpMethod":"GET", 
        "sendNoQueue":true, 
        "bypassCache":true, 
        "callback":{
            "target":[GbsRestDataSource ID:contractRestDS]
        }, 
        "willHandleError":true, 
        "serverOutputAsString":true, 
        "clientContext":{
            "requestIndex":2
        }, 
        "data":null
    }

    SmartClient Version: SC_SNAPSHOT-2011-01-06/LGPL Deployment (built 2011-01-06)

    #2
    The criteria of the FilterEditor will be advanced if there is a date field present and the new default filterEditorType for a date field is used (MiniDataRangeItem) since that produces a date range that cannot be represented in the simple criteria format.

    You can override this via setting filterEditorType to "DateItem" to lose the date range feature, or use DataSource.transformRequest to down-convert to simple criteria and represent the date range in some special way specific to your backend (or just implement full AdvancedCriteria handling in your server).

    Comment


      #3
      OK. Thanks.

      That makes sense. I had assumed if I didn't put a date value in the filter, the column would be ignored.

      Mike

      Comment


        #4
        It's like that in the latest nightlies. But either way, you'd need to handle the new format or revert to a DateItem for filtering dates.

        Comment

        Working...
        X