- Home
- Forum
- React - EJ 2
- how to identify deleteOccurence vs deleteSeries and editOccurence vs editSeries
how to identify deleteOccurence vs deleteSeries and editOccurence vs editSeries
hi, I am trying to override the default CRUD operations and I use RTK queries. so I am action on actionBegin level and execute my own CRUD. i have twomain issues:
2/ when an event is in series, how to know the type of operation selected: delete event, delete entire series, and same for editing. is there a variable to capture the selection made by the user? currently, i use the following:
at popupopen, i capture if the event has a recurrencID to differentiate between a single event or an event in a series. but later, i use
which apparently is the same for occurence or series operations so I am unable to differentiate between deleteOCcurence and deleteSeries
3/ i have the following error whilecompleting some of the CRUD operations:
util.js:411 Uncaught TypeError: nameSpace.indexOf is not a function
at DataUtil.getObject (util.js:411:1)
at JsonAdaptor.remove (adaptors.js:476:1)
at JsonAdaptor.batchRequest (adaptors.js:262:1)
at DataManager.saveChanges (manager.js:480:1)
at Observer.<anonymous> (crud.js:627:1)
at Observer.notify (observer.js:105:1)
at ComponentBase.trigger (component-base.js:258:1)
at Crud.processDelete (crud.js:594:1)
at Crud.deleteEvent (crud.js:297:1)
at QuickPopups.dialogButtonClick (quick-popups.js:985:1)
thanks
I am using this variable to differentiate between occurence or series operations:
for occurence operations we have two objects in data[0] ===2: occurence and parent and in series operations, we have a singloe object with all its key:values (>2)
an i already identify from popupopen if the event is part of a series or not (recurrencID presence).
that is the way to differentiate between single events, occurence in a series and entire series operations.
is it this approach reliable or is there a straight forward way to capture a variable when selecting in the alert window...
now i have an issue that when i edit a single event (in serie or standalone) the editor is ok, but when i select series editing, the editor opens and immediately closes. how can i capture the selection on the editingalert to know the choioce made and act accordingly. thanks
this is my code:
const onPopupOpen = (args) => { if(args.type == "Editor") { console.log("Current Action is:" ,scheduleObj.current.currentAction); } }; const onActionBegin = (args) => { if(args.requestType == 'eventCreate' || args.requestType == 'eventChange' || args.requestType == 'eventRemove') { console.log("Current Action is:", scheduleObj.current.currentAction); } }; <ScheduleComponent width='100%' height='650px' selectedDate={new Date(2021, 1, 20)} ref={scheduleObj} eventSettings={eventSettings} popupOpen={onPopupOpen} actionBegin={onActionBegin}> |
Attachment: Screen_Recording_20241104_190651_d079d57d.zip
hi Swathi Ravi,
thanks for your assistance.
i will definitely use your code.
for question 3, i figured out that the state update block was causing the immediate closure of the editor. as soon as i removed it, it was workign fine.
kind regards
mohamed bachali,
You're welcome! We're happy to hear that our solution was helpful and that you were able to resolve query 3 on your own.
- 5 Replies
- 2 Participants
-
MB mohamed bachali
- Nov 2, 2024 07:27 AM UTC
- Nov 5, 2024 03:53 AM UTC