Announcement

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

    AdvancedCriteria instead of normal criteria

    Without being able to give a stand-alone example (I've made too many customized components), I hope that simply asking the question might help.

    Has something changed that SmartClient now sends AdvancedCriteria objects instead of normal criteria? I have used SmartClient 12 of januari 12th, 2022 and I see a request (on my custom, RubyOnRails server) with "normal" criteria. If I upgrade SmartClient (either version 12 or 13), I suddenly sends AdvancedCriteria.

    I have set the allowAdvancedCriteria option to false in several places (operationBindings, the grid, the data source) but nothing helps. Maybe it's something related to something else. Like I said, I have a customized grid with a custom search form in it. I also have the showFilterEditor option set and I subclass TreeGrid.

    Hope this helps explaining the issue. Any help is highly appreciated.

    #2
    This is probably related to a bugfix: when a load on demand TreeGrid is fetching children by parentId, that should use exact match. It used to instead use the textMatchStyle used by the current criteria, which, with a filterEditor, would be "substring" by default.

    The only way to reconcile the criteria from the filterEditor that wants "substring" matching vs the load-on-demand criteria generated by the TreeGrid, which wants "exact" matching, is to convert to AdvancedCriteria.

    But we left in a way to turn off this up-conversion if the correctness of the criteria doesn't really matter to you:

    https://www.smartclient.com/smartcli...pleCriteriaLOD

    You can set this property via TreeGrid.dataProperties.

    Comment


      #3
      Wow, that's a really quick response, thanks for that!

      Unfortunately, it didn't work. I've placed this code in the init() method of my custom tree grid class:

      Code:
      this.dataProperties = isc.addProperties({
        modelType: 'parent',
        openProperty: 'isOpen',
        parentIdField: 'parent_id',
        useSimpleCriteriaLOD: true
      }, this.dataProperties);
      
      this.Super('init', arguments);
      Is there another property that I should set?

      Comment


        #4
        Can you provide a screenshot or log for both the old and new cases, so we can see how the criteria are being sent in both cases? It sounds like you're using a customized server so you may not be able to show the requests in the RPC tab of the Developer Console - that would be the preferred way.

        Also, you say that the problem happens when you upgrade from the 2022-01-12 patch build of SC 12.0. Do you mean that the most recent build of SC 12.0 also has the problem, or were you referring to upgrading to SC 12.1+?

        Comment


          #5
          I will look into this later, because I probably need to set up a stand-alone example to make sure that I'm not introducing the problem myself. This seems to be fair, but is in daily routine very hard to achieve to be honest. I did create custom components years ago and for this particular client I'm still using this old stuff, while upgrading SmartClient once in a while. To get the request that causes this problem, is probably not default grid behavior.

          Most of the time I think that the way SmartClient tries to be backwards compatible is more than should really be needed, but now I'm quite surprised that this functionality suddenly stops working because criteria are sent totally different. But like I said, this might be my own "mistake".

          Comment

          Working...
          X