SmartClient Version: v13.0p_2023-08-23/AllModules Development Only (built 2023-08-23)
Chrome on MacOS
Hello, I think I succeeded in putting together a test case for what may be a bug (or maybe I'm misinterpreting how the framework should behave). I've got a grid and a form, bound to the same dataSource, where the form is used to add records to the grid. The grid is initially sorted.
I know the grid will be unsorted after the add, but the behaviour I'm seeing doesn't seem right.
Please try this test case:
If you add a record, you'll see this add:
and this fetch:
with INFO level on the ResultSet category I see:
which seems to confirm the unsort, and the invalidateCache which triggers the fetch.
The doc mention dropping the cache, but I'm not sure that is right to have this fetch right after the add.
Moreover it ends with the grid unsorted and the new record out of view, which seems to defeat the purpose of the unsorting.
Chrome on MacOS
Hello, I think I succeeded in putting together a test case for what may be a bug (or maybe I'm misinterpreting how the framework should behave). I've got a grid and a form, bound to the same dataSource, where the form is used to add records to the grid. The grid is initially sorted.
I know the grid will be unsorted after the add, but the behaviour I'm seeing doesn't seem right.
Please try this test case:
Code:
isc.ListGrid.create({ ID: "dsListGrid", width: "100%", height: 500, autoFetchData: true, dataSource: "supplyItem", canEdit: true, sortField: "itemName" }); isc.DynamicForm.create({ ID: "aForm", top: 520, dataSource: "supplyItem", fields: [ {name: "itemName"}, {name: "SKU"}, {name: "description"}, {name: "category"}, {name: "units"}, {name: "unitCost"}, {name: "inStock"}, {name: "nextShipment"}, {type: "button", click: "aForm.saveData()", title: "Save"} ] }) aForm.editNewRecord()
Code:
{ dataSource:"supplyItem", operationType:"add", componentId:"aForm", data:{ nextShipment:"2023-08-24", itemName:"test", SKU:"324133", description:"fdsgsdfg", category:"Account Books", units:"Roll", unitCost:12, inStock:true }, textMatchStyle:"exact", callback:{ target:[DynamicForm ID:aForm], methodName:"saveEditorReply" }, showPrompt:true, prompt:"Saving form...", oldValues:{ }, requestId:"supplyItem$6277", internalClientContext:{ }, fallbackToEval:false, editor:[DynamicForm ID:aForm], lastClientEventThreadCode:"MUP7", bypassCache:true, dataProtocol:"getParams" }
Code:
{ dataSource:"supplyItem", operationType:"fetch", componentId:"dsListGrid", data:{ }, startRow:0, endRow:75, textMatchStyle:"substring", resultSet:[ResultSet ID:isc_ResultSet_2 (dataSource: supplyItem, created by: dsListGrid)], callback:{ caller:[ResultSet ID:isc_ResultSet_2 (dataSource: supplyItem, created by: dsListGrid)], methodName:"fetchRemoteDataReply" }, willHandleError:true, showPrompt:true, prompt:"Finding Records that match your criteria...", oldValues:{ }, requestId:"supplyItem$6278", internalClientContext:{ requestIndex:2 }, fallbackToEval:false, promptStyle:"component", lastClientEventThreadCode:"TMR2", bypassCache:true, dataProtocol:"getParams" }
Code:
16:47:50.124:XRP8:INFO:ResultSet:isc_ResultSet_2 (dataSource: supplyItem, created by: dsListGrid):updating cache in place after operationType: add, cached rows: 77, total rows: 3959 16:47:50.124:XRP8:INFO:ResultSet:isc_ResultSet_2 (dataSource: supplyItem, created by: dsListGrid):Updating cache: operationType 'add' submitted by 'aForm',1 rows update data 16:47:50.130:XRP8:INFO:ResultSet:isc_ResultSet_2 (dataSource: supplyItem, created by: dsListGrid):doSort: sorting on properties [] : directions [] : invalidating cache 16:47:50.130:XRP8:INFO:ResultSet:isc_ResultSet_2 (dataSource: supplyItem, created by: dsListGrid):Invalidating cache 16:47:50.131:XRP8:INFO:ResultSet:isc_ResultSet_2 (dataSource: supplyItem, created by: dsListGrid):getRange(0, 1) will fetch from 0 to 75 16:47:50.143:TMR1:INFO:ResultSet:isc_ResultSet_2 (dataSource: supplyItem, created by: dsListGrid):getRange(0, 31) will fetch from 0 to 75 16:47:50.150:TMR1:INFO:ResultSet:isc_ResultSet_2 (dataSource: supplyItem, created by: dsListGrid):getRange(0, 31) will fetch from 0 to 75 16:47:50.153:TMR2:INFO:ResultSet:isc_ResultSet_2 (dataSource: supplyItem, created by: dsListGrid):fetching rows 0,75 from server 16:47:50.416:XRP8:INFO:ResultSet:isc_ResultSet_2 (dataSource: supplyItem, created by: dsListGrid):Received 75 records from server 16:47:50.417:XRP8:INFO:ResultSet:isc_ResultSet_2 (dataSource: supplyItem, created by: dsListGrid):cached 75 rows, from 0 to 75 (3960 total rows, 75 cached)
The doc mention dropping the cache, but I'm not sure that is right to have this fetch right after the add.
Moreover it ends with the grid unsorted and the new record out of view, which seems to defeat the purpose of the unsorting.
Comment