Announcement

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

    [bug] filterData with AdvancedCriteria and grid filter

    SmartClient Version: v9.0p_2013-08-20/EVAL Development Only

    browser: Chrome

    modify #filter sample like this:
    Code:
    isc.ListGrid.create({
        ID: "countryList",
        width:500, height:300, alternateRecordStyles:true,
    top:50,
        dataSource: worldDS,
        fields:[
            {name:"countryCode", title:"Code", width:50},
            {name:"countryName", title:"Country"},
            {name:"capital", title:"Capital"},
            {name:"continent", title:"Continent"},
    {name:"population"}
        ],
        autoFetchData: true,
        showFilterEditor: true
    })
    
    
    isc.IButton.create({
       title:"Set Advanced Criteria", autoFit:true,
      click:function() {
        countryList.filterData({_constructor: "AdvancedCriteria", operator: "and",
                    criteria: [
                        {fieldName: "population", operator: "greaterThan", value:10000000}
                    ]});
      }
    })
    
    
    isc.IButton.create({
       title:"Set empty Criteria", autoFit:true, left:150,
      click:function() {
        countryList.filterData();
      }
    })
    
    
    isc.IButton.create({
      title:"Log Criteria", left:300,
      click:function () {
        isc.logEcho(isc.JSON.encode(countryList.getCriteria()))
      }
    })
    then click 'Set Advanced Criteria'. Press 'Log criteria'.
    Everything is working:
    Code:
    19:16:24.294:MUP8:WARN:Log:"{
        "_constructor":"AdvancedCriteria", 
        "operator":"and", 
        "criteria":[
            {
                "fieldName":"population", 
                "operator":"greaterThan", 
                "value":10000000, 
                "_constructor":"AdvancedCriteria"
            }
        ]
    }"
    then, click 'Set empty Criteria'. Press 'Log criteria'.
    Everything is working:
    Code:
    19:17:30.350:MUP4:WARN:Log:"{
    }"
    last, select a continent in the filter editor, say 'Asia'. Press 'filter' and then press 'Log criteria'.
    This isn't right:
    Code:
    19:19:19.871:MUP0:WARN:Log:"{
        "_constructor":"AdvancedCriteria", 
        "operator":"and", 
        "criteria":[
            {
                "fieldName":"population", 
                "operator":"greaterThan", 
                "value":10000000
            }, 
            {
                "fieldName":"continent", 
                "operator":"equals", 
                "value":"Asia"
            }
        ]
    }"
    how did it resurrected former criteria:
    Code:
    {
                "fieldName":"population", 
                "operator":"greaterThan", 
                "value":10000000
    }
    ?

    #2
    We've made a change to address this - please retest with a build dated September 19 or later.

    Note that, in the meantime, you can just set allowFilterExpressions: true to work around it - of course, you will actually be able to see and edit the advanced criteria then also
    Last edited by Isomorphic; 18 Sep 2013, 08:20.

    Comment


      #3
      now it's working, thank you very much.
      Last edited by claudiobosticco; 20 Sep 2013, 02:51.

      Comment

      Working...
      X