Announcement

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

    Different "fetch" behavior in 8.2 and 8.3

    Hi,

    We have a question about the fetch behavior in 8.3 (v8.3p_2013-04-29 build).

    In 8.2 (v8.2p_2013-03-04 build), whenever we call script like "treeGrid.fetchData({fetchIds: "_all_"})", the fetch action is actually executed, but in 8.3 the fetch is only executed once for the first time and is not executed again if we pass in with the same fetchIds.

    This behavior actually breaks some behaviors in our product. We are wondering if this is a desired behavior, and if so is there any way to handle this condition?

    We tried to use treeGrid.invalidateCache() to force the fetch but we lost the tree's open&collapse information at client side.

    Thanks!

    #2
    We're not sure what you mean by "fetch action", but if you mean a network request to the server, a treeGrid.fetchData() call may not result in a request to the server, this is explained on the docs for treeGrid.fetchData(), and this was the case in both 8.2 and 8.3.

    Comment


      #3
      Thanks for your response.

      To make the question more clear, please try the following example in the feature explorer:

      Code:
      isc.TreeGrid.create({
          ID: "employeeTree",
          width: 500,
          height: 400,
          dataSource: "employees",
          nodeIcon:"icons/16/person.png",
          folderIcon:"icons/16/person.png",
          showOpenIcons:false,
          showDropIcons:false,
          closedIconSuffix:"",
          loadDataOnDemand:false,
          fields: [
              {name: "Name", width:"40%"},
              {name: "Job"},
              {name: "EmployeeType"},
              {name: "Salary", formatCellValue: "isc.Format.toUSDollarString(value*1000)"}
          ]
      });
      
      
      isc.Button.create({
      top: 430,
      title:"Fetch",
      click: function() {
       employeeTree.fetchData({fetchIds: "_all_"});
      }
      })
      In 8.2, every we click the "Fetch" button, there will be a DSRequest sent to the server. However, in 8.3, only for the first time when we click the "Fetch" button, a DSRequest is sent. Then there's no DSRequest sent if we click the button again.

      Is there any way to force the fetch to send the DSRequest in 8.3? We tried to use "TreeGrid.invalidateCache()" to force the fetch every time, but there is another issue: We render "openProperty" as "isOpen" in the tree dataSource. We find that the value for "isOpen" is lost on client side after we call "TreeGrid.invalidateCache()", so the tree is expanded/collapsed improperly.

      Comment


        #4
        TreeGrid implements client-side filtering for fully-loaded trees just like ListGrid implements client-side filtering for fully-loaded lists, so fetchData() does not always result in a server call.

        To avoid the issue with the openProperty, the simplest thing is to add a criterion that is always different, for example:

        Code:
        fetchData({ fetchIds:"_all_", ts:new Date().getTime() });

        Comment


          #5
          Thanks for the previous replay. It solves our issue.

          We just have another question about the folder-expand-restoring behavior after the fetching. We notice that on client side in the process of fetching the Data, the folder's open state is stored by getOpenState() and then restores by setOpenState(). We are wondering if their is a way to disable this feature since we want that the "open" state is always retrieved from the server.

          Thanks!

          Comment


            #6
            We don't currently have a flag to achieve this directly. We're currently looking into whether it's something that makes sense to add as a framework change or whether there's another solution that seems more appropriate. We'll follow up when we have some more information

            Regards
            Isomorphic Software

            Comment


              #7
              Thanks for your response!

              Comment


                #8
                Hi,

                We just observe a folder expand/collapse behavior change after fetching the data in 8.2 and 8.3 by using the modified code.

                Steps to reproduce:
                1. Click the "Fetch" button to fetch the data.
                2. Click the "+" button to expand the root.
                3. Click the "Fetch" button to fetch the data again.

                In 8.2, the root is collapsed after the third step while in 8.3, the root is opened.

                Can you please suggest how to achieve the same 8.2 behavior in 8.3? Thanks!

                Code:
                isc.TreeGrid.create({
                    ID: "employeeTree",
                    width: 500,
                    height: 400,
                    dataSource: "employees",
                    nodeIcon:"icons/16/person.png",
                    folderIcon:"icons/16/person.png",
                    showOpenIcons:false,
                    showDropIcons:false,
                    closedIconSuffix:"",
                    loadDataOnDemand:false,
                    dataProperties: {openPropery:"isOpen"},
                    fields: [
                        {name: "Name", width:"40%"},
                        {name: "Job"},
                        {name: "EmployeeType"},
                        {name: "Salary", formatCellValue: "isc.Format.toUSDollarString(value*1000)"}
                    ]
                });
                
                
                isc.Button.create({
                top: 430,
                title:"Fetch",
                click: function() {
                 employeeTree.fetchData({fetchIds: "_all_", ts: new Date().getTime()});
                }
                })

                Comment


                  #9
                  Any response would be appreciated! Thanks!

                  Comment


                    #10
                    Sorry for the silence. We have been working on this issue, and do not yet have a solution, but we expect to have something in place to resolve things this week.
                    We'll keep you informed.

                    Regards
                    Isomorphic Software

                    Comment


                      #11
                      We have added support for explicitly setting a flag to govern whether the current "open state" of dataBound treeGrid (as set by the user's interactions with the tree) is preserved.
                      This is governed by the property "autoPreserveOpenState". Setting this property to "never" will not attempt to preserve the current open state when new data arrives (so the "openProperty" specified directly on the data received from the server will be respected).

                      Regards
                      Isomorphic Software

                      Comment


                        #12
                        Thanks! It solves our issue。

                        Comment

                        Working...
                        X