Hi Isomorphic,
I've found a bug with ListGrid inline editing with editByCell. How to reproduce:
1. Double click on a first row first column
2. Enter random text and press Tab
3. Enter other random text and press Tab
All other rows react the same - first edit column is sent to server and others not.
Situation:
In console you can see that only on step 2. you'll see performDSOperation: Arguments(4) ["update",] operation going.
and on step 3. no action is taken.
Preliminary case:
it's due somehow internal object of DynamicForm is placed into ListGrid.localData and then further changes of DynamicForm object instantly reflects to localData's row info and thus suppresses ability to detect what fields have changed. Because of that no further update operations is triggered..
I've suspected:
1) isc.Selection.dataArrived: where updateData = this.data._lastUpdateData; is passed down to dataChanged()
2) and then isc.Selection.dataChanged: calls ruleScopeComponent.provideRuleContext(ds.getID(), modifiedRecord, grid, hasStableID); which mangles internal structures of ListGrid/ResultSet somehow.
tried to add this.shallowCopy() in isc.Selection.dataArrived but with no luck.. hope you'll find out faster why is this happening
All versions are affected:
Tested on latest - 12.0p/LGPL/2020-03-24
and 12.1d/LGPL/2020-03-24
down to 12.0p/LGPL/2019-07-27
Here is code for test:
I've found a bug with ListGrid inline editing with editByCell. How to reproduce:
1. Double click on a first row first column
2. Enter random text and press Tab
3. Enter other random text and press Tab
All other rows react the same - first edit column is sent to server and others not.
Situation:
In console you can see that only on step 2. you'll see performDSOperation: Arguments(4) ["update",] operation going.
and on step 3. no action is taken.
Preliminary case:
it's due somehow internal object of DynamicForm is placed into ListGrid.localData and then further changes of DynamicForm object instantly reflects to localData's row info and thus suppresses ability to detect what fields have changed. Because of that no further update operations is triggered..
I've suspected:
1) isc.Selection.dataArrived: where updateData = this.data._lastUpdateData; is passed down to dataChanged()
2) and then isc.Selection.dataChanged: calls ruleScopeComponent.provideRuleContext(ds.getID(), modifiedRecord, grid, hasStableID); which mangles internal structures of ListGrid/ResultSet somehow.
tried to add this.shallowCopy() in isc.Selection.dataArrived but with no luck.. hope you'll find out faster why is this happening
All versions are affected:
Tested on latest - 12.0p/LGPL/2020-03-24
and 12.1d/LGPL/2020-03-24
down to 12.0p/LGPL/2019-07-27
Here is code for test:
Code:
const testData = [ {id: 1, name: "test", code: "test"}, {id: 2, name: "test", code: "test"}, {id: 3, name: "test", code: "test"}, ]; const parent = { performDSOperation: isc.DataSource.getPrototype().performDSOperation }; const dataSource = isc.DataSource.create({ ID: "ds", clientOnly: true, testData: testData, fields: [ { hidden: true, primaryKey: true, name: "id", type: "sequence", required: false }, { title: "Name", name: "name", length: 50, type: "text", required: true }, { title: "Code", name: "code", length: 20, type: "text", required: false } ], performDSOperation: function () { console.log("performDSOperation: ", arguments); return parent.performDSOperation.apply(this, arguments); }, fetchData: function (criteria, callback, requestProperties) { console.log('fetchData: ', criteria, requestProperties); this.performDSOperation("fetch", criteria, callback, requestProperties); }, }); const listgrid = isc.ListGrid.create({ autoDraw: true, width: "100%", height: "100%", dataSource: dataSource, canRemoveRecords: true, autoFetchData: true, dataProperties: {useClientFiltering: false, useClientSorting: false}, canEdit: true, editByCell: true }); isc.Button.create({title: "Refresh", autoDraw: true}).click = () => { listgrid.invalidateCache() }
Comment