Array object not callable in popup menu

Hi all,
I’d want to delete multiple selected rows from a table using a right-click popup menu. So, I’ve put this script on mouseRelease event handlers in my table component:

def deleteRows(event):
        import system
	rows = event.source.selectedRows()
	lista.data = system.dataset.deleteRows(event.source.data, rows)

menu = system.gui.createPopupMenu({"Delete Selected Rows":deleteRows})
menu.show(event)

In runtime, I get this error:

[quote]Traceback (most recent call last):

File “event:mouseReleased”, line 3, in

TypeError: ‘array.array’ object is not callable
[/quote]

The deleteRows function is working fine on the script console.
Any idea how to handle .selectedRows() return datatype in the defined function?

Thanks in advance!

Change the third line to:

rows = event.source.selectedRows

Yes!! That did work!
I tried that you suggested on the Script Console, and printed the return. I got <bound method com.inductiveautomation.factorypmi..., so I assumed that was not the good way. Obviously, I was wrong! :blush:
Thanks!!