omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    reordering a TableView in pythonista

    Pythonista
    1
    2
    1472
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • polymerchm
      polymerchm last edited by

      Is this doable? I understand (I think) how its accomplished in native iOS, but ot sure if @OMZ has exposed enough.

      1 Reply Last reply Reply Quote 0
      • polymerchm
        polymerchm last edited by

        Answering my own question:

        the pyui file is just a single tableview whose name is tableview1

        # coding: utf-8
        
        import ui
        
        lds = ui.ListDataSource(items="this is a test".split())
        
        
        v = ui.load_view()
        
        v['tableview1'].delegate = v['tableview1'].data_source = lds
        lds.move_enabled = True
        v['tableview1'].editing = True
        v.present('sheet')
        

        the order of the list in lds.items is in sync with what is displayed. All sorts of possibiities. Cool!

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Powered by NodeBB Forums | Contributors