Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.5.1 Cells are not editable in reponsive layout mode #4275

Closed
ortwic opened this issue Aug 17, 2023 · 7 comments
Closed

5.5.1 Cells are not editable in reponsive layout mode #4275

ortwic opened this issue Aug 17, 2023 · 7 comments
Labels
Possible Bug A possible bug that needs investigation

Comments

@ortwic
Copy link

ortwic commented Aug 17, 2023

Describe the bug
When reponsive layout mode is enabled the expanded cells are not editable anymore.

Tabulator Info
5.5.1

Working Example
https://stackblitz.com/edit/typescript-vcgxg4?file=index.ts

To Reproduce
Try to change value of favorite color or lucky number from the stackblitz example.

Expected behavior
Cells should stay editable regardless whether in collapsable area or not.

Desktop (please complete the following information):

  • Windows 10
  • Chrome, Firefox
  • latest
@ortwic ortwic added the Possible Bug A possible bug that needs investigation label Aug 17, 2023
@lekoala
Copy link
Contributor

lekoala commented Aug 18, 2023

it's not a bug, it's currently designed this way

there is a work in progress PR that i made #3875 but my current approach is not 100% aligned with what oli thinks good :-)

If you need this, in the meantime you can use my custom element that implement the custom features that i need
https://formidable-elements.vercel.app/demo/tabulator-grid.html (check the flexResponsive example)

@ortwic
Copy link
Author

ortwic commented Aug 18, 2023

Thank you very much. I'll give it a try.

Yes you could argue that way and I understand that's kinda missing feature. But as a user I'd not care about some technical issues and expect that the app will keep its functionallity regardless of its resolution or format.

Is it generally possible to inject "own" modules for tabulator? It kinda looks that way. Would be nice to import that as a custom module.

@lekoala
Copy link
Contributor

lekoala commented Aug 21, 2023

as long as you build it yourself, it's not too hard. tabulator is built in a quite nice modular way and it's easy enough to add formatters/editors/modules . overriding modules is also not too hard, that what i did to get the responsive editing to work
https://github.com/lekoala/formidable-elements/blob/master/src/classes/tabulator/ResponsiveLayout/ResponsiveLayout.js

@ortwic
Copy link
Author

ortwic commented Aug 29, 2023

@lekoala Your solution is not working for me neither. So I have to implement my own ResponsiveLayoutModule too. :-(

But it was helpful to find out how to integrate a custom module.

Anyways the row is missing in the ResponsiveLayoutModule and should be passed on toggle for further customizations.

Also if you use arrow functions instead of regular ones you avoid the var self = this workarounds as arrow function don't have their own context.

@lekoala
Copy link
Contributor

lekoala commented Aug 29, 2023

@ortwic if you managed to make something useful don't forget to make a pr maybe that could be merged :-)
i'd be happy not to have my own little hacks for this to work

@ortwic
Copy link
Author

ortwic commented Aug 30, 2023

The fix is actually quite easy. See here:

ortwic#1

Personally I prefer a formatter with flex layout. It is working both ways.

const cellFormatter = (data) => {
    //data - an array of objects containing the column title and value for each cell
    if (Object.keys(data).length) {
    
        const list = document.createElement('div');
        list.classList.add('flex');

        data.forEach(({ title, value }) => {
            const item = document.createElement('div');
            const label = document.createElement('label');
            label.innerHTML = title;
            item.appendChild(label);

            if (value instanceof Node) {
                item.appendChild(value);
            } else {
                const p = document.createElement('p');
                item.innerHTML = value;
                item.appendChild(p);
            }
            
            list.appendChild(item);
        });
        return list;
    }
    return '';
};

@ortwic
Copy link
Author

ortwic commented Aug 30, 2023

I realized changing the visibility state of the columns results in a somewhat buggy behaviour. But this is also true for the current released version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Possible Bug A possible bug that needs investigation
Projects
None yet
Development

No branches or pull requests

3 participants