kivy problem z MDDataTable

0

Witam. Mam taki problem. Chcę przełączać screeny, które są w pliku kivy
To zawartość pliku kivy

MDBoxLayout:
orientation: 'vertical'

ScreenManager:
    id: screen_manager
    #transition: WipeTransition()

    # Karta logowania
    MDScreen:
        name: 'login'

        MDCard:
            size_hint: None,None
            size: 300, 400
            pos_hint: {"center_x": 0.5, "center_y": 0.5}
            padding: 25
            spacing: 25                
            orientation: 'vertical'

            MDLabel:
                id: my_Label
                text: "Zaloguj się do aplikacji"
                font_size: 15
                halign: "center"
                size_hint_y: None
                height: self.texture_size[1]
                padding_y: 2

        # Karta wyboru godziny
    MDScreen:
        name: 'hour_detail_screen'             
        
        MDCard:
            size_hint: None,None
            size: 600, 400
            pos_hint: {"center_x": 0.5, "center_y": 0.5}
            padding: 5
            spacing: 5                
            orientation: 'vertical' 

MDBottomAppBar:
    MDTopAppBar:
        title: "Wybierz menu"
        id: icon_button
        icon: "horse"
        type: "bottom"
        md_bg_bottom_color: 0, 1, 0, 1
        icon_color: 1, 0, 0, 5            
        left_action_items: [["menu", lambda x: app.presser("Menu")]]
        right_action_items:
            [
            ["home", lambda x: app.log_in(), "Home", "Home"],
            ["horse", lambda x: app.rezerwation_horse_card(self, 1), "Zmień konia", ""],
            ["calendar", lambda x: app.presser("Wiadomość powiadomienie"), "Zmień datę", "Message question"],
            ["office", lambda x: app.presser("Wiadomość odpowiedź"), "Message reply", "Message reply"],
            ]
        mode: "center"
        # kliknięcie buttona
        on_action_button: app.rezerwation_horse_card(self, 1)

        

W tym ostatnim tutaj MDScreen chciałem dodać MDDataTable, ale wyrzuca mi błąd albo nic nie wyświetla.

plik py
class OrderWidget(MDBoxLayout):
pass

class MainApp(MDApp):
def build(self):
#self.screen_manager = Builder.load_file('bbutton2.kv')
self.login_ok = False
self.selected_horse = None
self.date_now = datetime.datetime.now()
self.today_date = self.date_now.date()
return Builder.load_file('bbutton.kv')

def hour_detail(self, hour):
self.root.children[1].current = 'hour_detail_screen'

To oczywiście część kodu.

Nie iem jak zrobić, aby wywśietliło tej karcie hour_detail_screen właśnie MDDataTable

0
gtuszi napisał(a):

W tym ostatnim tutaj MDScreen chciałem dodać MDDataTable, ale wyrzuca mi błąd albo nic nie wyświetla.

Jaki błąd?

0
Traceback (most recent call last):
   File "kivy\properties.pyx", line 961, in kivy.properties.ObservableDict.__getattr__
 KeyError: 'container'
0

Wystarczyło, że kv dodałem

MDScreen:
    name: 'hour_detail_screen'             
    
    MDCard:
        size_hint: None,None
        size: 600, 400
        pos_hint: {"center_x": 0.5, "center_y": 0.5}
        padding: 5
        spacing: 5                
        orientation: 'vertical' 
      
    MDLabel:
        id: id_hour_d
        text: "Jakiś tekst"
                    
    MDDataTable:
        size_hint: (0.7, 0.6)
        use_pagination: True
        check: True

1 użytkowników online, w tym zalogowanych: 0, gości: 1