Announcement

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

    Using TreeGrid as ListGrid with dataFetchMode: "paged"

    Hello,

    I'm using SmartClient_v91p_2014-09-30_PowerEdition and I when I set dataFetchMode: "paged" and loadDataOnDemand: false on TreeGrid that doesn't have any parents and call fetchData I get 5 different calls to the server. When I set dataFetchMode to be basic I get only 1 call.

    The first call contain a startRow and endRow properties but the other calls doesn't.

    Any thoughts?

    #2
    Not sure what's causing this from your description. Best thing to do would be to show us a little test case we can run which demonstrates the problem. Feel free to reuse a dataSource from one of our shipped samples ("employees" or "supplyCategory" perhaps) to streamline this process.

    Paul

    Comment


      #3
      Here you go:

      isc.VLayout.create({

      members: [
      isc.TreeGrid.create({
      ID: "employeeTree",
      width: 500,
      height: 400,
      dataSource: "employees",
      autoFetchData:true,
      nodeIcon:"icons/16/person.png",
      folderIcon:"icons/16/person.png",
      showOpenIcons:false,
      showDropIcons:false,
      showOpener:false,
      initialCriteria: { ReportsTo: 1},
      loadDataOnDemand:false,
      dataFetchMode:"paged",
      closedIconSuffix:"",
      fields: [
      {name: "Name", formatCellValue: "record.Job+': '+value"}
      ]
      }),

      isc.Button.create({
      title: 'Fetch',
      click: function() {
      employeeTree.fetchData({ ReportsTo: 2});
      }
      })
      ]
      })

      Click on the Fetch button.

      This is what I see in the log:

      First call is with the start and end row
      === 2014-10-21 07:55:28,443 [sor3] DEBUG RPCManager - Request #1 (DSRequest) payload: {
      criteria:{
      ReportsTo:"1"
      },
      operationConfig:{
      dataSource:"employees",
      operationType:"fetch",
      textMatchStyle:"exact"
      },
      ****startRow:0,****
      ****endRow:75,****
      componentId:"employeeTree",
      appID:"builtinApplication",
      operation:"employees_fetch",
      oldValues:{
      ReportsTo:"1"
      },
      resultTreeIdField:"EmployeeId",
      resultTreeParentIdField:"ReportsTo"
      }

      Second call is without start and end row, and now it will start repeatedly sending requests to the server
      === 2014-10-21 07:55:28,457 [sor7] INFO SQLDataSource - [builtinApplication.employees_fetch] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhere
      === 2014-10-21 07:55:28,454 [sor1] DEBUG XML - Parsed XML from (in memory stream): 1ms
      === 2014-10-21 07:55:28,472 [sor7] INFO SQLDataSource - [builtinApplication.employees_fetch] 523: Executing SQL query on 'HSQLDB': SELECT employeeTable.userOrder, employeeTable.Nam
      === 2014-10-21 07:55:28,466 [sor3] INFO IDACall - Performing 1 operation(s)
      === 2014-10-21 07:55:28,502 [sor7] DEBUG PoolableSQLConnectionFactory - [builtinApplication.employees_fetch] DriverManager fetching connection for HSQLDB via jdbc url jdbc:hsqldb:fi
      === 2014-10-21 07:55:28,498 [sor1] DEBUG RPCManager - Processing 1 requests.
      === 2014-10-21 07:55:28,511 [sor7] DEBUG PoolableSQLConnectionFactory - [builtinApplication.employees_fetch] Passing JDBC URL only to getConnection
      === 2014-10-21 07:55:28,506 [sor3] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null
      === 2014-10-21 07:55:28,521 [sor7] DEBUG PoolableSQLConnectionFactory - [builtinApplication.employees_fetch] makeObject() created an unpooled Connection '140828651'
      === 2014-10-21 07:55:28,517 [sor1] DEBUG RPCManager - Request #1 (DSRequest) payload: {
      criteria:{
      ReportsTo:"1"
      },
      operationConfig:{
      dataSource:"employees",
      operationType:"fetch",
      textMatchStyle:"exact"
      },
      componentId:"employeeTree",
      appID:"builtinApplication",
      operation:"employees_fetch",
      oldValues:{
      ReportsTo:"1"
      },
      resultTreeIdField:"EmployeeId",
      resultTreeParentIdField:"ReportsTo"
      }

      Comment


        #4
        These are nonsense settings - dataFetchMode:"paged" doesn't make sense with loadDataOnDemand:false, and neither setting makes sense in the presence of initialCriteria that ensure that the server will not return the complete tree.

        Please revisit the docs for these settings for further details.

        Comment


          #5
          The title of the thread states that I want to use the TreeGrid as a ListGrid. The documentation for loadDataOnDemand is "For databound treeGrid instances, should the entire tree of data be loaded on initial fetch, or should folders load their children as they are opened". I don't have any children just a flat list that I want to be paged. So why are those nonsense settings?

          and BTW, you can use the test case I gave you without the initial criteria and it still act the same.

          Comment


            #6
            Your settings do not make sense together even if you remove the initialCriteria setting, we were just pointing out that initialCriteria plus either of the other two settings doesn't make sense either.

            Again see the docs for what dataFetchMode:"paged" actually means on a TreeGrid, which is very obviously incompatible with loadDataOnDemand:false, since it controls how paging works and loadDataOnDemand:false turns incremental loading of data off entirely.

            Overall, we have no idea what you mean by "use the TreeGrid as a ListGrid". If you have "just a flat list that [you] want to be paged" then use a ListGrid, and do not use a TreeGrid. If there is some feature from the TreeGrid you need to replicate in a ListGrid, ask about that instead.

            Comment


              #7
              Ok, I understand. Thank you

              Comment

              Working...
              X