Hi there,
I'm working again on the paged tree and have detected a bug.
Trying to use all features of the paged TreeGrid I have a case, where the tree does not load any additional children of the root.
At the serverside I have a big tree. There are mutliple children of root and multiple children of these children (root -> root-x -> root-x-y).
Every root-X noder should be open. The dataPageSize is set to 50, and the server does know this number. Because every root-x node is open, there is no need to respond all 50 root-x nodes. Instead I return the first 50 nodes, which could be root-x and root-x-y nodes.
With this I only have to transfer the nodes, which the user will see, if he begins scrolling.
This does work really well, so after scrolling a bit, there is a ds-request for root-x (to get the last 2 children).
Then the next children of the root are requested, by scrolling down there is another request for a root-x node to get the rest of the children to display.
After that there should be a request to get the next children of the root-node. But this request is not called. The tree does know, that there are some nodes missing, because the alternateRecordStyles is true, and there are some empty rows.
This is the network-log:
You can either scroll down (multiple times) or you can just close the folders one after the other:
It get's really hard to create a standalone example with the datasource to reproduce the same error. So I hope you can understand, that the example might look not so nice.
I have tested this with the latest nighty (SmartClient_v100p_2015-05-29_Pro) with chrome and firefox with the same result as shown above.
This is the code for reproduction:
Best regards
I'm working again on the paged tree and have detected a bug.
Trying to use all features of the paged TreeGrid I have a case, where the tree does not load any additional children of the root.
At the serverside I have a big tree. There are mutliple children of root and multiple children of these children (root -> root-x -> root-x-y).
Every root-X noder should be open. The dataPageSize is set to 50, and the server does know this number. Because every root-x node is open, there is no need to respond all 50 root-x nodes. Instead I return the first 50 nodes, which could be root-x and root-x-y nodes.
With this I only have to transfer the nodes, which the user will see, if he begins scrolling.
This does work really well, so after scrolling a bit, there is a ds-request for root-x (to get the last 2 children).
Then the next children of the root are requested, by scrolling down there is another request for a root-x node to get the rest of the children to display.
After that there should be a request to get the next children of the root-node. But this request is not called. The tree does know, that there are some nodes missing, because the alternateRecordStyles is true, and there are some empty rows.
This is the network-log:
You can either scroll down (multiple times) or you can just close the folders one after the other:
It get's really hard to create a standalone example with the datasource to reproduce the same error. So I hope you can understand, that the example might look not so nice.
I have tested this with the latest nighty (SmartClient_v100p_2015-05-29_Pro) with chrome and firefox with the same result as shown above.
This is the code for reproduction:
Code:
isc.VLayout.create({ "ID" : "rootLayout_5", "width" : "100%", "height" : "100%", "autoDraw" : true, "hideUsingDisplayNone" : false, "leaveScrollbarGap" : false, "members" : [ isc.Button.create({ title: "reload node 'root'", width: 200, click:function(){ theTreeGrid.data.reloadChildren(theTreeGrid.data.findById("root")); }} ), isc.TreeGrid.create({ "ID" : "theTreeGrid", "width" : "100%", "height" : "100%", "selectionType" : "multiple", "canEdit" : false, "showFilterEditor" : false, "dataArrived":function (node){ var theChilds = node.children; for (var i = 0; i < theChilds.length; i++){ eachChild = theChilds[i]; if(eachChild._isOpen === true){ delete eachChild._isOpen; theTreeGrid.data.openFolder(eachChild); } } }, "alternateRecordStyles" : true, dataSource : isc.DataSource.create({ "fields" : [{ "name" : "treeGridGeneratedIndex", "primaryKey" : true, "hidden" : true, "canView" : false }, { "name" : "nameField", "title" : "Reason", "type" : "text" }, { "name" : "parentId", "rootValue" : "root", "foreignKey" : "treeGridGeneratedIndex", "hidden" : true } ], "dataFormat" : "json", "dataURL" : "http://devset.de/treegrid3.php", "transformRequest" : requestTransformer, "transformResponse" : responseTransformer, "recordXPath" : "\/resultData", useHttpProxy : false }), dataProperties : { openProperty : "isOpen", childrenProperty : "children", canReturnOpenFolders: true, progressiveLoading : false }, "autoFetchData" : true, "dataPageSize" : 50, "dataFetchMode" : "paged", "selectionProperty" : "isSelected", "fields" : [{ "name" : "nameField", "title" : "Reason", "type" : "text", "canEdit" : true, "canSort" : true }, { "name" : "lastField", "title" : "Name", "type" : "text", "canEdit" : true, "canSort" : true }, { "name" : "randomField", "title" : "random", "type" : "text", "canEdit" : true, "canSort" : true } ], "selectionProperty" : "isSelected", "members" : [] }) ] }); function requestTransformer(dataSourceRequest) { var operationType = { operationType : dataSourceRequest.operationType }; if (dataSourceRequest.operationType == "fetch") { var params = { delay: 300, sortBy : dataSourceRequest.sortBy, start : dataSourceRequest.startRow, end : dataSourceRequest.endRow }; } return isc.addProperties({}, operationType, dataSourceRequest.data, params); } function responseTransformer(dataSourceResponse, dataSourceRequest, jsonData) { if (dataSourceRequest.operationType == "fetch") { dataSourceResponse.totalRows = jsonData.totalRows; dataSourceResponse.endRow = jsonData.endRow; dataSourceResponse.startRow = jsonData.startRow; } if (dataSourceRequest.operationType == "remove") { console.log(dataSourceRequest.componentId); console.log(this.componentId); dataSourceResponse.nodeId = dataSourceRequest.data.id; } }
Comment