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

MDDataTable clicking anywhere except from the table closes the table. #315

Closed
BananaMasterz opened this issue May 19, 2020 · 5 comments
Closed
Labels
Type: Enhancement Feature request/Feature implementation

Comments

@BananaMasterz
Copy link
Contributor

BananaMasterz commented May 19, 2020

Description of the Bug

I'm not actually sure if this is a bug but it sure looks like one. Whenever I tap anywhere off a table, the table disappears. I know MDDataTable is pretty new but I also can't seem to be able to put it in my KV file... I can only create it as a pop-up from my python file. Documentation's examples do the same as well. Is it supposed to be a dialog? Cuz I was very glad to see it as I'm working on an app that's mainly using tables to display data. I really dont wanna go back to using my table code cuz it's terrible compared to this new masterpiece.

Code and Logs

from kivy.metrics import dp

from kivymd.app import MDApp
from kivymd.uix.datatables import MDDataTable


class Example(MDApp):
    def build(self):
        self.data_tables = MDDataTable(
            size_hint=(0.9, 0.6),
            column_data=[
                ("Column 1", dp(30)),
                ("Column 2", dp(30)),
                ("Column 3", dp(30)),
                ("Column 4", dp(30)),
                ("Column 5", dp(30)),
                ("Column 6", dp(30)),
            ],
            row_data=[
                # The number of elements must match the length
                # of the `column_data` list.
                ("1", "2", "3", "4", "5", "6"),
                ("1", "2", "3", "4", "5", "6"),
            ],
        )

    def on_start(self):
        self.data_tables.open()

Screenshots

Add images to explain us this bug. Paste urls here.

Remove this section if no images here

Versions

  • OS: Windows 10
  • Python: 3.7
  • Kivy: 1.11.0
  • KivyMD: v0.104.1
@HeaTTheatR
Copy link
Member

@BananaMasterz Tables require refinement and improvement. Unfortunately, there is no time to do this yet.

@HeaTTheatR HeaTTheatR added the Type: Enhancement Feature request/Feature implementation label May 19, 2020
@BananaMasterz
Copy link
Contributor Author

@BananaMasterz Tables require refinement and improvement. Unfortunately, there is no time to do this yet.

Gotcha. Can't wait! Thank you for your work by the way. I feel like you don't get enough credit... kudos.

@FranciscoCarbonell
Copy link

FranciscoCarbonell commented Jul 11, 2020

MDDataTable inherit of BaseDialog, BaseDialog inherit of ModalView, By default, any click outside the view will dismiss it,

datatables.py

remove import BaseDialog and import ModalView

from kivy.uix.modalview import ModalView
class MDDataTable(ThemableBehavior, ModalView):
    auto_dismiss = BooleanProperty(False)

at least temporarily

@suvidh
Copy link

suvidh commented Aug 28, 2020

@FranciscoCarbonell is right.. they are a pop-up... that's the way the widget is designed. Some people may like the way it is some may not you are free to modify it in your own machine.

@HeaTTheatR
Copy link
Member

HeaTTheatR commented Oct 22, 2020

MDDataTable no longer inherits from ModalView class -
https://github.com/kivymd/KivyMD/blob/master/kivymd/uix/datatables.py#L823

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Feature request/Feature implementation
Projects
None yet
Development

No branches or pull requests

4 participants