excelR
excelR copied to clipboard
Can we use the `onchange` event?
Dear Swechhya,
Can we use the onchange
event?
I tried the following, but nothing happens when I change the table value.
onchange <- "function(instance, cell, x, y, value) { alert('test'); }"
excelTable(
data = df,
editable = TRUE,
wordWrap = TRUE,
autoWidth = TRUE,
autoFill = FALSE,
lazyLoading = TRUE,
loadingSpin = TRUE,
getSelectedData = FALSE,
columnSorting = FALSE,
columnResize = FALSE,
rowResize = FALSE,
columnDrag = FALSE,
rowDrag = FALSE,
allowInsertRow = FALSE,
allowInsertColumn = FALSE,
allowDeleteRow = FALSE,
allowDeleteColumn = FALSE,
allowRenameColumn = FALSE,
allowComments = FALSE,
columns = columns_df,
# ...
tableOverflow = TRUE,
contextMenu = FALSE,
defaultColAlign = 'left',
onchange = htmlwidgets::JS(onchange)
)
@daeyoonlee the onchange
event cannot be overwritten as this function handles the core change in the table. If you could tell me the use case then I could you help with it.
Sorry for the late reply. This is because I wanted to make varius input validation at the client side. for example,
- popup warning
- typo auto fix
- make input NG message to another cell
It can also be performed on the server side, but considering the network response delay, I thought that it would be helpful for the user experience to proceed with JavaScript on the client side.