Ask our community for help with v1.x versions of our products.

Post by Veena »

Hi, We use similar code in our code base. Its used to update the events for a particular resource when an event is moved from one date to another. The expected behaviour is the sequential events should also be moved to furture dates for a forward based move . So accordingly the updated events are sent from the server to the UI.

write: function EventStore_onWrite(store, operation, eOpts) {
    if (operation.wasSuccessful() && (resultsetRecords.length > 1)) {
        var updateData = [];
        $.each(resultsetRecords, function(i, serverRecord) {
            //  some logic
            if (noDuplicate) {
                updateData.push(serverRecord);
            }
        });
        store.loadData(updateData, true);
    }
}

With the above code internally clearData() is not called as we pass the param true (since its an update). So the data gets added to some existing set of data.
The problem is that there are still some old events left by the end of view after the movement occurs. But those old events are not present in any of the updated list. Its always correct data everywhere.

For ex: If I have events from 1-12 within a timeline between Jan 2020 to Dec 2020(1 event for a month), and If I move an event 5 to after the event 8, (hence the moved event will have a new start datetime) and sequential events will also have respective new start dates. The updated events should have 3 items less which would start from new 5th event in the 8th month until 12th. But I can see the new Updated events as well as the last 3 old events due to which the last 3 months have 2 events each. This happens only with update. loadRawData(data) this does not happen.


Post by mats »

Why do you post here? Please in the correct product forum

Tired of debugging javascript errors in web applications? Try our powerful error logging service RootCause


Post by Veena »


Post Reply