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

Data and display issues #44

Open
HumanWannabe opened this issue May 6, 2024 · 1 comment
Open

Data and display issues #44

HumanWannabe opened this issue May 6, 2024 · 1 comment

Comments

@HumanWannabe
Copy link

Hello,

I am working in Svelte-kit and trying to implement a table as part of my interface. The table is used to show a list of options and can be updated both programmatically and by the user directly changing things. In my endeavors I found a couple of issues which I would like to list here, some as ideas and others as bug reports.

First of all, when I first saw that you can pass the data as an attribute to the active-table component, I really hoped that this would work reactively in the spirit of Svelte! So I hoped that by doing:

<active-table data={mydata}/>

This would update the table whenever my data was programmatically updated, and update my data whenever the table was directly edited by the user. I understand that this might be too hard to do, but I will leave it here as an idea, as it would be an amazing feature to have. The closest I got, was to update the table, by hiding it and showing it again after myData was updated. The problem with this, and this is what I consider the first bug, is that if you supply the data like this, the on****Update events do not seem to work at all!

So then I switched to using updateData() to update my data, and then the update events work fine, but I got another bug, which is that the displayAddNewColumn="false" is no longer respected, and I always get the button to add new rows! Then I switched to updateStructure() which has much smoother update, but again the displayAddNewColumn="false" is not respected. It seems that this only works if the data is passed as a property.

Finally, one thing that has been bugging me a lot, is the cell styling, and specifically the cell height! I wanted to remove the default padding, so that I can fit more cells in my screen. I did this by adding cellStyle='{"padding": "1px"}' and the padding is indeed respected. But the height is not adjusted to match the new padding, so the cell content just moves to the top of the cell. I tried setting height=auto or even a fixed height=20px in different places (cellStyle, rootCell, row, table etc.) but nothing seems to work. Is there a way to make this work?

Thanks and sorry for bundling so many issues in one request, but I thought it might be better than spamming with different requests, especially as most issues are connected.

@HumanWannabe
Copy link
Author

Sorry, I forgot to mention that the getData() function is also not working if you pass the data as an attribute. In general, attributes and methods/events do not seem to blend well..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant