I have an embedded dropdown menu within a table column. When I click on the dropdown the menu appears for a split second and then instantly disappears before I can select anything. If I hold down the dropdown option it stays and gives me a chance to click an option, but as soon as it populates the table it disappears.
column parameters:
dropdown parameters
dropdown action performed script
def runAction(self, event):
"""
This event is fired when the 'action' of the component occurs.
Arguments:
self: A reference to the component that is invoking this function.
event: An empty event object.
"""
column = self.view.params.column
row = self.view.params.rowIndex
value = self.view.params.value
messageType = 'UpdateColumn'
payload = {'column':column, 'row':row, 'value':value}
system.perspective.sendMessage(messageType, payload, scope='page')
table Message handler
def onMessageReceived(self, payload):
"""
This method will be called when a message with the matching type code
arrives at this component.
Arguments:
self: A reference to this component
payload: The data object sent along with the message
"""
column = payload['column']
value = payload['value']
row = payload['row']
self.props.data[row][column] = value
table on edit complete, although it's my understanding that this shouldn't matter for an embedded view
def runAction(self, event):
"""
Fired when a user has effectively committed an edit on a cell via return or
enter key press.
Arguments:
self: A reference to the component that is invoking this function.
event: An object with the following attributes:
column (str | int): The column of the edited cell.
row (int): The unique row index as it is represented in the source
data. Also known as the row ID.
rowIndex (int): The row index as it is represented in the current
visible data.
value (int | float | bool | str): The committed value.
"""
#update dataset with edited value
dataSet = self.props.data
newDataSet = system.dataset.setValue(dataSet, event.row, event.column, event.value)
self.props.data = newDataSet
Thanks!