Our pure JavaScript Scheduler component


Post by Aniket »

Team,
Has there any issue been reported in 3.1.9 where autoSync does not detect the rowReorder(shuffling of resource row).

I am facing the issue of autoSync not detecting the change when I interchange the row since update to 3.1.9. and the changes are not psoted to the server

Regards,
Aniket


Post by saki »

Changing of order of records in resourceStore does not change the data what is the reason why the request is not sent. For persisting order of records it is necessary to maintain a presistable index (or order) field that would be updated on "shuffling of resource row". This change would be then picked and request would be sent.

Post please a show case if you want us to investigate it any further and help you to achieve what you need.


Post by Aniket »

Saki,

Basically, when the user shuffles the resource row, I want autoSync to pick this change and send to backend so that it can saved.


Post by saki »

I see. It has not been designed that way. You need to have a persistent field that would hold the order information and update this field on reorder. Then data will change so it will trigger the save.

The server-side code must already implement some order logic so it needs such field anyway. Looping through all records sent in a different order would not be too effective.


Post by Aniket »

Saki,
We do have a field which has the order sequence.

But the thing is autoSync in 3.1.4 detected rowReorder feature and sent changes to backend

While 3.1.9 does not pick up change


Post by Aniket »

Saki any idea on above isue?


Post by Aniket »

To reproduce this issue.
Open any example from version 3.1.9 of angular

step1 set autoSync to true in crudManager

step2 enable the rowreorder feature

step3 Shuffle any of the rows (Nothing is triggered)

step4 Drag Drop any event, autoSync picks this one and sends changes ,

step5 Now again shuffle any row, this time you would see autoSync pick this change and send the changes!!!

Hope I was able to convey this point.

This issue was not prresent in v 3.1.4


Post by Aniket »

Any thoughts on above?


Post by saki »

Yes, I was able to reproduce the behavior using our https://bryntum.com/examples/scheduler/crudmanager/ example (modified to use rowReorder feature and autoSync:true). Setting rowReorder:true does trigger the request but it does not send any useful data.

I would suggest to introduce a persistent order field and change its data in the code similar to this:

    features : {
        rowReorder : {
            listeners : {
                gridRowDrop : ({ context }) => {
                    console.log(context.record, context.insertBefore);
                    // set here the persistent order field value 
                    // based on the above data. That should trigger the sync.
                }
            }
        },

Post by Aniket »

Saki,

I have assemblyOrder field in my resources array, But How do I set it when the user shuffles any rows?
This is how my resource data looks

  {
                "id": 41,
                "IdentityNumber": 7,
                "name": "Resource1",
                "isLocked": false,
                "utilization": 0.0,
                "manufacturingDate": "2020-09-22T00:00:00Z",
                "resourceId": 9        
"assemblyOrder": 41, "manufacturingLocationId": 1 },

Any idea how do I reset the shuffled values?


Post Reply