Our pure JavaScript Scheduler component


Post by mos »

I'm experiencing a consistency/stability issue with the taskeditor.

The issue started when I attached a custom grid to the editor.
I'm loading the config first then attaching the store using beforeTaskEditShow as a trigger (snippet included below).

  1. The included clip will show after a page load, the first attempt to open the taskeditor from a drag-create action fails. This happens every time. There is no error provided to the console. The second attempt is successful.

  2. Keeping the modal window open is when navigating the grid. In this example, selecting "no results" from the combo closes the modal.
    In other experiences, the modal also occasionally closes either when an item is selected from a connected store, or when the list from the combo-grid-widget is scrolled or simply when the combo-grid-widget caret is clicked (clip 2)

  3. In a quick attempt to prevent focus being lost, wasn't able to get modal working. Even when rolling customizations back.

I've included code to fit the context below.

Thanks!

====

Editor Config Snippet

const taskEditorConfig = {
modal: true,
items: {
resourceGridTab: {
items: {
            roomGrid: {
                type: 'grid',
                name: 'roomGrid',
                store: [],
                columns: [
                    {
                        type: 'widget',
                        text: "Room",
                        widgets: [
                            {
                                type: 'combo',
                                store: [],
                                name: 'resourceId',
                                multiSelect: false,
                            }
                        ]
                    }
                ]
            }
        }
}
}
}

Store Attachment

beforeTaskEditShow(event) {
attachStoreToGrid({event})
}
function attachStoreToGrid({event}){

let
        eventStoreData = event.source.eventStore.records,
        widgetMap = event.editor.widgetMap;
        
let gridStore = new Store({ data: eventStoreData.filter(r => r.type == 'filteredType'), id: "gridStore" }); widgetMap.roomGrid.store = gridStore ; }
Attachments
B_Modal_6.mp4
Clip 2
(21.1 MiB) Downloaded 20 times
B_Modal_3.mp4
Clip 1
(28.61 MiB) Downloaded 20 times

Post by tasnim »

Hi,

I'm not able to reproduce it with 5.3. Could you please upload a runnable test case so we can check what's wrong?

Btw, I don't see any modal config available in task edit docs
https://bryntum.com/products/schedulerpro/docs/api/SchedulerPro/feature/TaskEdit

Good Luck :),
Tasnim


Post by mos »

I've updated to 5.3 and will review and provide a runnable case or pen for points 1 & 2 later.

I'm currently testing out the modal as a workaround to the referenced issue.
(btw, the modal boolean is set within editorConfig).

The current blocker - I'm getting a "Maximum call stack size exceeded" error.
I occasionally encountered this previously and it appears to be the result of performing a drag-create action on a resource that's also present/assigned on the embedded taskEditor grid.

Drag-creating on a non-assigned resource doesn't result in this error (subsequent drag-create actions don't produce an error).
The error appears similar to this recently reported item: error is viewtopic.php?p=119313

Certainly advise if a new post would be needed for this.

Edit: Correction. This error is triggered from any create action on a taskEditor-grid listed resource.
It's not limited to drag-create actions alone.

Full error:

Uncaught (in promise) RangeError: Maximum call stack size exceeded
at AssignmentStore.assignEventToResource (schedulerpro.module.js:136632:26)
at ClassDefEx.applyResourceId (schedulerpro.module.js:142197:27)
at set resourceId [as resourceId] (schedulerpro.module.js:142166:10)
at set resource [as resource] (schedulerpro.module.js:142159:21)
at AssignmentStore.assignEventToResource (schedulerpro.module.js:136632:26)
at ClassDefEx.applyResourceId (schedulerpro.module.js:142197:27)
at set resourceId [as resourceId] (schedulerpro.module.js:142166:10)
at set resource [as resource] (schedulerpro.module.js:142159:21)
at AssignmentStore.assignEventToResource (schedulerpro.module.js:136632:26)
at ClassDefEx.applyResourceId (schedulerpro.module.js:142197:27)


Post by tasnim »

Hi,

Sorry for the late response.

Unfortunately, I'm still not able to reproduce the issue. Can please upload a runnable test case where we can reproduce the issue?
Or If you are able to reproduce it with our online demo https://bryntum.com/products/schedulerpro/examples/
Then could you please provide the steps to reproduce it?

All the best,
Tasnim


Post by Animal »

A Popup closes when focus exits. It appears as though that is what is hiding the TaskEditor, but I cannot be sure of that.

That Combo widget has to have an owner. The owner hierarchy must lead all the way up to the Editor itself so that focus ownership can be ascertained.

If you set the browser to emulate a focused page:

Screenshot 2023-03-09 at 08.16.24.png
Screenshot 2023-03-09 at 08.16.24.png (91.31 KiB) Viewed 263 times

Then bring up the editor, then highlight the Combo's element using the debugger's highlighting, and capture the widget using

w=bryntum.fromElement($0)

Then look at w.owner. It should be the sub grid of the grid.

What I often to is set a debugger breakpoint in the Widget hide method:

Screenshot 2023-03-09 at 08.21.18.png
Screenshot 2023-03-09 at 08.21.18.png (150.78 KiB) Viewed 263 times

then when it does that unexpected hide, take a look at the call stack and see how it got there.


Post by mos »

Regarding issue #4 - the "call stack size exceeded" error.

I've created the following pen to resemble the structure and shape of data I'm working with.
I've been able to replicate the stack error (and other variants).

To trigger it, open the task editor and scroll down the grid (+review console messages).

There are some differences in the project - in my case, the list is much shorter as I'm filtering a handful of records; the stack error causes the grid to stop loading (up to whichever resource was selected from the scheduler).
I also have 2 grids on the same tab (removing the second grid gives the same error).

And thanks @Animal - I'll review this


Post by tasnim »

Hi Mos,

Thank you for the test case. Reproduced! We'll investigate it deeply. Here is the ticket to track progress https://github.com/bryntum/support/issues/6338

All The Best,
Tasnim


Post by mos »

Hi Tasnim,

A brief check if there has been any traction on this or if a workaround may exist?

Thanks!


Post by mats »

Not yet but we've marked this issue as high prio and will try to fix it for 5.3.2


Post by mos »

Thanks Mats!


Post Reply