Announcement

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

    Server side Criteria

    Hello,
    i'm developing an application using SmartGwt Power 3.0.

    I'm writing my own server side DMI logic, and i have a question about server side Criteria.

    I have a ListGrid with listGrid.setShowFilterEditor(true). So i only refer to Criteria genereted by a standard ListGrid filter editor.

    Looking at SmartGwt logs, i see that sometimes i have a like this:

    criteria:{
    name:"aa"
    },
    operationConfig:{
    dataSource:"instr",
    operationType:"fetch",
    textMatchStyle:"substring"
    },
    startRow:0,
    endRow:75,
    componentId:"isc_StaticDataGrid_1",
    appID:"builtinApplication",
    operation:"fetch",
    oldValues:{
    instrumentName:"gdf"
    }


    , and in other cases i have a second "criteria" element into the first, like this:

    criteria:{
    operator:"and",
    _constructor:"AdvancedCriteria",
    criteria:[
    {
    fieldName:"name",
    operator:"iContains",
    value:"sa"
    },,
    {
    fieldName:"code",
    operator:"iContains",
    value:"as"
    },
    {
    fieldName:"type",
    operator:"equals",
    value:"F"
    },
    {
    fieldName:"updateDate",
    operator:"greaterOrEqual",
    value:new Date(1354057200000)
    },
    {
    fieldName:"updateDate",
    operator:"lessOrEqual",
    value:new Date(1354229940000)
    }
    ]
    }



    My question is: in general, what types of client side DataSourceFields generate server side AdvancedCriteria when filtering on a ListGrid?



    Thank you in advance.


    Giervella

    #2
    There are a number of cases where AdvancedCriteria would be used, but two that apply here would be:

    1. fields of type "date" or "datetime", which offer date range filtering by default

    2. setting FormItem.operator via listGridField.filterEditorType. If there are mixed operators in play, criteria needs to be in the AdvancedCriteria format.

    Comment

    Working...
    X