error in running examples of datatable

185 views
Skip to first unread message

Joel Buitizon

unread,
Feb 15, 2021, 2:36:08 AM2/15/21
to Kivy users support
whenever i try to run examples from different tutorials of datatable it gives this error

 ValueError: TableRecycleGridLayout.orientation is set to an invalid option 'vertical'. Must be one of: ['lr-tb', 'tb-lr', 'rl-tb', 'tb-rl', 'lr-bt', 'bt-lr', 'rl-bt', 'bt-rl']

i copied the example from kivymd.readthedocs.io

Joel Buitizon

unread,
Feb 15, 2021, 11:36:59 AM2/15/21
to Kivy users support
please help, im trying this example now


from kivymd.app import MDApp
from kivymd.uix.screen import Screen
from kivymd.uix.datatables import MDDataTable
from kivy.metrics import dp


class DemoApp(MDApp):

    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        screen = Screen()
        data_table = MDDataTable(orientation='tb-lr',
                                 pos_hint={'center_x': 0.5, 'center_y': 0.5},
                                 size_hint=(0.9, 0.6),
                                 check=True,
                                 rows_num=10,
                                 column_data=[
                                     ("No.", dp(18)),
                                     ("Food", dp(20)),
                                     ("Calories", dp(20))
                                 ],
                                 row_data=[
                                     ("1", "Burger", "300"),
                                     ("2", "Oats", "200"),
                                     ("3", "Oats", "200"),
                                     ("4", "Oats", "200"),
                                     ("5", "Oats", "200"),
                                     ("6", "Oats", "200"),
                                     ("7", "Oats", "200"),
                                     ("8", "Oats", "200")

                                 ]
                                 )
        data_table.bind(on_row_press=self.on_row_press)
        data_table.bind(on_check_press=self.on_check_press)
        screen.add_widget(data_table)

    def on_row_press(self, instance_table, instance_row):
        print(instance_table, instance_row)

    def on_check_press(self, instance_table, current_row):
        print(instance_table, current_row)


DemoApp().run()

but it gives this error

scr44.PNG

Robert

unread,
Feb 15, 2021, 12:43:56 PM2/15/21
to Kivy users support
KivyMD is in development, it is a moving target. It looks like some class initialization changed.

It is possible that the version of KivyMD installed on your computer is not the same as the one documented.
Part of the problem is I think the documented version is the unreleased version :(

This is what you could try:

A 'pip3 list' will tell you the version you have installed.

The documented versions are listed here:

I notice I have 1.104.2.dev0 , which is not listed there; it is an install of the 'unreleased' version from a few months ago.
You probably want the unreleased version.
The version number of an unreleased version does not change with each content change.

Alternatively, the way to see what your version of KivyMD expects is to read the source.
The 'tags' under the button showing 'master'  will allow you to select the version.

Expect this experience with software that is in development.

Joel Buitizon

unread,
Feb 15, 2021, 9:24:11 PM2/15/21
to Kivy users support
thankyou sir.

Joel Buitizon

unread,
Feb 16, 2021, 2:07:06 AM2/16/21
to Kivy users support
hello again sir, so i tried ot install other kivy versions and tried to run again some examples and this is the new error it gives.

scr46.PNG
scr45.PNG

Elliot Garbus

unread,
Feb 16, 2021, 7:21:49 AM2/16/21
to kivy-...@googlegroups.com

In the last line of the program change to: DemoApp().run()

 

From: Joel Buitizon
Sent: Tuesday, February 16, 2021 12:07 AM
To: Kivy users support
Subject: [kivy-users] Re: error in running examples of datatable

 

hello again sir, so i tried ot install other kivy versions and tried to run again some examples and this is the new error it gives.

 

thankyou sir.

On Monday, February 15, 2021 at 3:36:08 PM UTC+8 Joel Buitizon wrote:

whenever i try to run examples from different tutorials of datatable it gives this error

 

 ValueError: TableRecycleGridLayout.orientation is set to an invalid option 'vertical'. Must be one of: ['lr-tb', 'tb-lr', 'rl-tb', 'tb-rl', 'lr-bt', 'bt-lr', 'rl-bt', 'bt-rl']

 

i copied the example from kivymd.readthedocs.io

 

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/369308ea-42fa-439e-9c7f-4a2758d7df79n%40googlegroups.com.

 

scr46.PNG
scr45.PNG
Reply all
Reply to author
Forward
0 new messages