Hello, figured out almost everything I needed for my project but can't seem to figure this last bit out. I want to let the user select a row from a table that has 6 columns. From the row selected I want to send the order number over to the main page from the popup window. Here is what I have. I'm not sure what to add to the props.selection.data to just send the order number across. Any ideas anyone?
props.selection.selectedRow will give you the selected row number.
EDIT: I think I misunderstood your question, whoops.
EDIT 2: On testing, @Transistor's syntax doesn't quite work if your data is formatted like the example table with the data array; it should be textValue = self.getSibling("Table").props.selection.data[0].city
If it's a dataset, you should be able to use data.getValueAt(0, columnName)
EDIT: I tested it out and it looks like selection.data should still be an array of objects, even if the table source is a dataset. in that case Transistor's solution would apply (with the corrected syntax in my first post).
You haven't really got a column named 'Order#' have you? Python will take the # as the start of a comment (as indicated by the editor changing color to green).
You shouldn't need to change the name, Perspective's almost certainly sanitized it somehow internally. You just need to find what the sanitized version is so you can use it in your code.
EDIT: looking at later screenshots, it looks like Perspective sanitizes nothing and happily keeps the # at the end of the column name, that's interesting and good to know.
I mean if that's your actual SQL column name maybe that's not the best name but that's neither here nor there
There's another way to reference the column name but I can't remember the exact syntax. Something like, self.getSibling("Table").props.selection.data[0]['Order#']
Anyone?