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

getSelectedRowData using handle_left_click #232

Open
nira123 opened this issue Oct 24, 2022 · 0 comments
Open

getSelectedRowData using handle_left_click #232

nira123 opened this issue Oct 24, 2022 · 0 comments

Comments

@nira123
Copy link

nira123 commented Oct 24, 2022

Hi Damien,
I have seen solution given to override some methods.
I need to get selected row data while moving through rows (i.e left click ) and delete selected row with delete button if necessary.
I noticed there is a method called getSelectedRowData() and handle_left_click(self, event).
How do I bind getSelectedRowData() to left click such that I get selected row data without effecting to pandas table features?

I used following code with directly overriding rowheader.bind and pt.bind . It is not working as expected.

  
        pt.bind("<Delete>", pt.deleteRow)
        pt.rowheader.bind('<Button-1>',self.handle_left_click)    
        
            
    def handle_left_click(self,event):
        """Handle left click"""
        rowclicked_single = pt.get_row_clicked(event)
        pt.setSelectedRow(rowclicked_single)
        print(pt.getSelectedRowData())
        pt.redraw()

Could you please provide some suggestions to implement this if you do not mind.
Many thanks.

@nira123 nira123 changed the title How to getSelectedRowData in handle_left_click How to getSelectedRowData using handle_left_click Oct 24, 2022
@nira123 nira123 changed the title How to getSelectedRowData using handle_left_click getSelectedRowData using handle_left_click Oct 24, 2022
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