Announcement

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

    autoFetchTextMatchStyle

    In SmartGWT 2.4 I have simple ListGrid with JSON datasource and filterEditor. I have Text column and Date column in list. Strange behaviour:
    a)
    When I keep ListGrid.autoFetchTextMatchStyle to default value ('substring').
    I filter in text column and correct AdvacedCriteria are created with iContains and value stay in filter row - expected
    b)
    When I set ListGrid.autoFetchTextMatchStyle to 'startsWith'.
    Then I filter in textcolumn of ListGrid correct AdvacedCriteria are created with iStartsWith but value DISAPPEAR from filter row - why?
    c)
    When I hide DateField (just by right clicking listgrid header ...) correct simple criteria are created and value stay

    I would like to make b) case running. I need to send 'startWith' to server and keep value showed in filterRow. Is it unsupported case?

    Thank you

    Pavel
    Code:
    ===============
    RPCRequest for case a)
    {
        "actionURL":"/service", 
        "showPrompt":true, 
        "prompt":"Vyberam data .... pockajte chvilku", 
        "transport":"xmlHttpRequest", 
        "useSimpleHttp":true, 
        "promptStyle":"cursor", 
        "params":{
            "operator":"and", 
            "_constructor":"AdvancedCriteria", 
            "criteria":[
                {
                    "fieldName":"ico", 
                    "operator":"iContains", 
                    "value":"789"
                }
            ], 
            "_operationType":"fetch", 
            "_startRow":0, 
            "_endRow":50, 
            "_textMatchStyle":"substring", 
            "_componentId":"mainListGrid", 
            "_dataSource":"dPPO2010Service", 
            "isc_metaDataPrefix":"_", 
            "isc_dataFormat":"json"
        }, 
        "httpMethod":"GET", 
        "sendNoQueue":true, 
        "bypassCache":true, 
        "callback":{
            "target":[RestDataSource ID:dPPO2010Service]
        }, 
        "willHandleError":true, 
        "serverOutputAsString":true, 
        "clientContext":{
            "requestIndex":1, 
            "$69t":null
        }, 
        "data":null
    }
    ===============
    RPCRequest for case b)
    {
        "actionURL":"/service", 
        "showPrompt":true, 
        "prompt":"Vyberam data .... pockajte chvilku", 
        "transport":"xmlHttpRequest", 
        "useSimpleHttp":true, 
        "promptStyle":"cursor", 
        "params":{
            "operator":"and", 
            "_constructor":"AdvancedCriteria", 
            "criteria":[
                {
                    "fieldName":"ico", 
                    "operator":"iStartsWith", 
                    "value":"123"
                }
            ], 
            "_operationType":"fetch", 
            "_startRow":0, 
            "_endRow":50, 
            "_textMatchStyle":"startsWith", 
            "_componentId":"mainListGrid", 
            "_dataSource":"dPPO2010Service", 
            "isc_metaDataPrefix":"_", 
            "isc_dataFormat":"json"
        }, 
        "httpMethod":"GET", 
        "sendNoQueue":true, 
        "bypassCache":true, 
        "callback":{
            "target":[RestDataSource ID:dPPO2010Service]
        }, 
        "willHandleError":true, 
        "serverOutputAsString":true, 
        "clientContext":{
            "requestIndex":1, 
            "$69t":null
        }, 
        "data":null
    }
    
    ===============
    RPCRequest for case c)
    {
        "actionURL":"/service", 
        "showPrompt":true, 
        "prompt":"Vyberam data .... pockajte chvilku", 
        "transport":"xmlHttpRequest", 
        "useSimpleHttp":true, 
        "promptStyle":"cursor", 
        "params":{
            "ico":"456", 
            "_operationType":"fetch", 
            "_startRow":0, 
            "_endRow":50, 
            "_textMatchStyle":"startsWith", 
            "_componentId":"mainListGrid", 
            "_dataSource":"dPPO2010Service", 
            "isc_metaDataPrefix":"_", 
            "isc_dataFormat":"json"
        }, 
        "httpMethod":"GET", 
        "sendNoQueue":true, 
        "bypassCache":true, 
        "callback":{
            "target":[RestDataSource ID:dPPO2010Service]
        }, 
        "willHandleError":true, 
        "serverOutputAsString":true, 
        "clientContext":{
            "requestIndex":1, 
            "$69t":null
        }, 
        "data":null
    }

    #2
    We'd need a runnable test case for your report of criteria values disappearing. Please test against the latest nightly as well.

    Comment


      #3
      I tested with latest SmartGWT 2.5 (2011-04-22), it's better but still not working. Go to "Smartclient showcase -> Grids -> Data types -> Date" and evaluate following code. After inserting value "i" to Country and setting any date and pressing filter icon, "i" disappear from filter row. When you remove 'autoFetchTextMatchStyle: "startsWith" ' everything is OK.
      Code:
      isc.ListGrid.create({
          ID: "countryList",
          showFilterEditor: true,
          width:500, height:224, alternateRecordStyles:true,
          canEdit:true, editEvent:"click", modalEditing:true,
          data: countryData, autoFetchTextMatchStyle: "startsWith",
          fields:[
              {name:"countryCode", title:"Flag", width:50, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png", canEdit:false},
              {name:"countryName", title:"Country"},
              {name:"independence", title:"Nationhood",
                  type: "date", filterEditorType:"MiniDateRangeItem"
              }
          ]
      })

      Comment


        #4
        This example has no DataSource - the filterEditor requires a DataSource in order to function.

        Comment


          #5
          Filtering isn't working but hiding filter value works same way. Try my steps. Can you reproduce it?

          Comment


            #6
            Sorry, we don't understand what you're saying - your sample code is invalid (you can't use the FilterEditor without a DataSource) so there's no point trying any set of steps with it.

            Comment


              #7
              I mean filter editor. Here is another sample. "Data binding -> Lists -> Datasource fields". Evaluate attached source code. Select some date range (from yesterday, to tomorrow), type "i" in Country filter field and press Enter. Value "i" disappear from filter row after pressing Enter. When you remove 'autoFetchText....' from source code, and try same steps, value "i" stay in filter row. Reproducible?
              Code:
              isc.ListGrid.create({
                  ID: "countryList",
                  width:500, height:224, alternateRecordStyles:true, 
                  dataSource: countryDS,
                  autoFetchData: true,
              autoFetchTextMatchStyle: "startsWith",
              showFilterEditor: true,
              })

              Comment


                #8
                Reproducible, and now fixed - try the next nightly build.

                Comment


                  #9
                  Originally posted by Isomorphic
                  Reproducible, and now fixed - try the next nightly build.
                  Thank you for fixing. I will try.

                  Comment


                    #10
                    Originally posted by Isomorphic
                    Reproducible, and now fixed - try the next nightly build.
                    Hello,

                    I have the same problem in SmartGWT pro 2.5p 27.3.2012 nb

                    I use filtereditor in listgrid and AutoFetchTextMatchStyle is set to "STARTS_WITH". When I enter something to filter editor, the results are filtered and the text in filtereditor disappears.

                    Comment


                      #11
                      We are not aware of this being an issue at this stage and it's not happening for us in simple tests.
                      If you can show us a simple test case demonstrating the problem we'll take a look.

                      (Note you should be able to put together a simple standalone example without us needing access to your actual server-side dataSource logic by either using a client-only dataSource, or modifying some existing source from the showcase)

                      Regards
                      Isomorphic Software

                      Comment

                      Working...
                      X