Our blazing fast Grid component built with pure JavaScript


Post by guilherme.reeeliance »

When using AjaxStore Grid with Vue.js 3 + Nuxtjs 3 Bryntum grid

Git issue https://github.com/bryntum/support/issues/8788

"@bryntum/grid": "5.6.8",
"@bryntum/grid-vue-3": "5.6.8",

The server its responding normally with the filter working but the bryntum its havings this errors

We are having this problem when the user hits one character

Image

TypeError: Cannot read properties of undefined (reading 'dataset')
at Proxy.processCellContent (http://localhost:3000/_nuxt/node_modules/@bryntum/grid-vue-3/src/WrapperHelperVue3.js?v=a0350e9d:52:38)
at Proxy.renderCell (http://localhost:3000/_nuxt/node_modules/@bryntum/grid/grid.module.js?v=a0350e9d:94800:60)
at Proxy.render (http://localhost:3000/_nuxt/node_modules/@bryntum/grid/grid.module.js?v=a0350e9d:94655:17)
at Proxy.renderFromRow (http://localhost:3000/_nuxt/node_modules/@bryntum/grid/grid.module.js?v=a0350e9d:95802:11)
at Proxy.refresh (http://localhost:3000/_nuxt/node_modules/@bryntum/grid/grid.module.js?v=a0350e9d:95867:8)
at Proxy.refreshRows (http://localhost:3000/_nuxt/node_modules/@bryntum/grid/grid.module.js?v=a0350e9d:103605:18)
at Proxy.resumeRefresh (http://localhost:3000/_nuxt/node_modules/@bryntum/grid/grid.module.js?v=a0350e9d:103697:14)
at Proxy.internalOnStoreEndApplyChangeset (http://localhost:3000/_nuxt/node_modules/@bryntum/grid/grid.module.js?v=a0350e9d:102960:10)
at Proxy.trigger (http://localhost:3000/_nuxt/node_modules/@bryntum/grid/grid.module.js?v=a0350e9d:5064:34)
at Proxy.syncDataset (http://localhost:3000/_nuxt/node_modules/@bryntum/grid/grid.module.js?v=a0350e9d:28184:8)

And when the user hits a second character this error

Image
TypeError: 'get' on proxy: property 'parser' is a read-only and non-configurable data property on the proxy target but the proxy did not return its actual value (expected '#<NumberParser>' but got '#<NumberParser>')
at Proxy.parse (http://localhost:3000/_nuxt/node_modules/@bryntum/grid/grid.module.js?v=a0350e9d:20878:41)
at Proxy.changeValue (http://localhost:3000/_nuxt/node_modules/@bryntum/grid/grid.module.js?v=a0350e9d:66566:58)
at Proxy.set (http://localhost:3000/_nuxt/node_modules/@bryntum/grid/grid.module.js?v=a0350e9d:1628:44)
at Reflect.set (<anonymous>)
at MutableReactiveHandler.set (http://localhost:3000/_nuxt/node_modules/.cache/vite/client/deps/chunk-DSIC5XJC.js?v=a0350e9d:1517:32)
at Proxy.updateColumnFilterFields (http://localhost:3000/_nuxt/node_modules/@bryntum/grid/grid.module.js?v=a0350e9d:83763:25)
at Proxy.onStoreFilter (http://localhost:3000/_nuxt/node_modules/@bryntum/grid/grid.module.js?v=a0350e9d:83877:12)
at Proxy.trigger (http://localhost:3000/_nuxt/node_modules/@bryntum/grid/grid.module.js?v=a0350e9d:5064:34)
at Proxy.triggerFilterEvent (http://localhost:3000/_nuxt/node_modules/@bryntum/grid/grid.module.js?v=a0350e9d:24876:12)
at Proxy.afterPerformFilter (http://localhost:3000/_nuxt/node_modules/@bryntum/grid/grid.module.js?v=a0350e9d:24871:14)

After this the bryntum stop working

After Hours and Hours of debug i think i found the source of this problem
This on the performFilter method where did you guys have a promise internalLoad

const result = await me.internalLoad({}, "", (event)=>{
                me.data = event.data;
                event = silent ? null : {
                    action: "filter",
                    filters,
                    oldCount,
                    records: me.storage.values
                };
                me.afterPerformFilter(event);
                me.trigger("refresh", event);
            }

on my tests the start of all errors its this part.

to reproduce this error just add on the columns the vue property as true to trigger this function on the
WrapperHelperVue3.js

function processCellContent({
        rendererData,
        rendererData: { record },
        rendererData: { cellElement },
        rendererData: { column },
        rendererHtml: cellContent
    }) {
        // Only run for cells with vue renderers
        if (column.data.vue) {
            const
                { vueComponent } = this,
                {
                    refs,
                    refs: { teleportsHolder }
                }                = vueComponent,
                // `teleports` is javascript Map object
                {
                    teleports: { value: teleports }
                }                = vueComponent.provides,
                key              = `${column.id}-${record.id}`,
                renderElement    = column.tree
                    ? cellElement.querySelector('.b-tree-cell-value')
                    : cellElement,
                // Move the previous teleport to the hidden div
                stale            = renderElement.querySelector('[data-vue]');

            if (stale) {
                teleportsHolder.appendChild(stale);
            }

            // Find cached teleport
            let cached = refs[key];

            // Fix for new version of Vue (3.27) and #4879
            cached = Array.isArray(cached) ? cached[0] : cached;

            // Check if record changed
            if (cached && cached.$el.dataset.generation !== String(record.generation)) {
                teleports.delete(key);
                cached = null;
            }

            // Move cached back to the cell
            if (cached) {
                renderElement.appendChild(cached.$el);
            }
            else {
                // Teleport might have been deleted so let the DOM settle down
                nextTick(() => {
                    const bind = { ...cellContent };
                    const { is } = bind;
                    delete bind.is;

                    // Create new teleport
                    teleports.set(key, {
                        bind,
                        key,
                        is,
                        to         : renderElement,
                        generation : record.generation
                    });
                });
            }
        }
    }
Last edited by guilherme.reeeliance on Sat Mar 16, 2024 5:35 pm, edited 2 times in total.

Post by ghulam.ghous »

Hi there,

Welcome to forums!

We have two filtering demos available online in vue3. Are you able to reproduce this issue in them?
https://bryntum.com/products/grid/examples/frameworks/vue-3/javascript/filterbar/dist/
https://bryntum.com/products/grid/examples/frameworks/vue-3-vite/filtering/dist/

If not, can you please share more details on how to reproduce this issue including a runnable test case. So we can reproduce this and see if this is a bug or something is wrong with your config, either way we will be able to assist you in a better way. You can see our guidelines about a test case here viewtopic.php?f=35&t=772.

Regards,
Ghous


Post by guilherme.reeeliance »

I just add more details about the problem on the post.


Post by guilherme.reeeliance »


Post by ghulam.ghous »

Hi there,

Apologies for the delayed response. I have created a ticket to further investigate and fix this issue https://github.com/bryntum/support/issues/8846. As you have mentioned, and I have confirmed that it is only happening when we vue: true config is used. I wonder why you have to use this config because we have demos available where custom Vue renderers are used and this config is not needed. Here's a demo: https://bryntum.com/products/grid/examples/frameworks/vue-3/javascript/vue-renderer/dist/. But in any case I have created a ticket where we will investigate this. For the time being, please try removing this config because I do not see a vue component being rendered in the test case and simple html will do the trick.

Regards,
Ghous


Post by guilherme.reeeliance »

Hi @ghulam.ghous
So i need the render on my project for a custom Widget.
And just as an example to reproduce the error i made on this way to you guys can see the problem.
As simple having the vue as true the filter stop works.


Post by ghulam.ghous »

Hi there,

Well although setting vue: true without a renderer should not break anything but this does not make any sense when you are setting this config without a renderer. Because in our VueWrapper, we use vue: true config to check that a vue component is used. But in any case, this should not break anything and we have a ticket a where we will fix this issue. But for the time being, please remove this config where you are not using a vue component as a renderer. Another thing that I want to mention here is, that this issue does not have anything to do with the filter functionality.

Regards,
Ghous


Post by guilherme.reeeliance »

In fact when I remove this property and use redender the data simply disappears, because i try to render a vue component. and i only receive the error message when i try to make a filter.
Did you see this on the example ?
Its clear when you filter something you will receive an error, also if i remove the vue property on my production code the cells appears blank because they are not rendered at all.
https://vue3-bryntum-filter-error.pages.dev

And complementing the error, this only happens when I use Ajaxstore with the filter search directly on the server, if I use FakeAjaxStore this does not happen only when I do it as AjaxStore. Exactly as in the problem mentioned above

Last edited by guilherme.reeeliance on Thu Mar 21, 2024 10:43 am, edited 1 time in total.

Post by guilherme.reeeliance »

And complementing the error, this only happens when I use Ajaxstore with the filter search directly on the server, if I use FakeAjaxStore this does not happen only when I do it as AjaxStore. Exactly as in the problem mentioned above


Post by ghulam.ghous »

Hi there,

And complementing the error, this only happens when I use Ajaxstore with the filter search directly on the server, if I use FakeAjaxStore this does not happen only when I do it as AjaxStore. Exactly as in the problem mentioned above

Not really. This error does not have anything to do with AjaxStore. Please see the attached project where this issue can be easily reproducible. Just edit a name column cell and press enter. Here's the clip: https://drive.google.com/drive/folders/1qFdJKnMS5Yni7xOPBHRVEc2jybfgjf-n?usp=sharing
Project example:

And you can test it by removing the vue: true config from the column that it works as expected.

In fact when I remove this property and use redender the data simply disappears, because i try to render a vue component.

I don't understand what you are trying to achieve here. Because as I mentioned earlier, when you are using a vue component, you need to pass the vue: true but when you are not using a custom vue component in renderer, you do not need this config.

PS: I was not able to run your application with your server config, as it was throwing cors errors. I reproduced the issue with loading data from json object. You can find the modified object in the ticket.

Long story short, the error being thrown is a bug which needs to be handled because when passing vue: true without a custom vue renderer, we expect it to work and we will send a fix for it.

Regards,
Ghous


Post Reply