Skip to content

Commit

Permalink
Merge pull request Swechhya#73 from Swechhya/fix-delete-column-issue
Browse files Browse the repository at this point in the history
Fix issue Swechhya#71
  • Loading branch information
Swechhya authored Jun 13, 2020
2 parents 2db2de9 + 8943ea0 commit 3c46f08
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion inst/htmlwidgets/jexcel.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
otherParams.oninsertrow = this.onChange;
otherParams.ondeleterow = this.onChange;
otherParams.oninsertcolumn = this.onChange;
otherParams.ondeletecolumn = this.onChange;
otherParams.ondeletecolumn = this.onDeleteColumn;
otherParams.onsort = this.onChange;
otherParams.onmoverow = this.onChange;
otherParams.onchangeheader = this.onChangeHeader;
Expand Down Expand Up @@ -192,6 +192,28 @@
})
}
},
onDeleteColumn: function(obj, deletedColumn){

if (HTMLWidgets.shinyMode) {
debugger;
var changedData = getOnChangeData (this.data, this.columns, this.colHeaders);

var newColHeader = changedData.colHeaders;
newColHeader.splice(deletedColumn, 1);

Shiny.setInputValue(obj.id,
{
data:changedData.data,
data:changedData.data,
data:changedData.data,
colHeaders: newColHeader,
colType: changedData.colType,
forSelectedVals: false,
forSelectedVals: false,
forSelectedVals: false,
})
}
},
onSelection: function(obj, borderLeft, borderTop, borderRight, borderBottom, origin){
if (HTMLWidgets.shinyMode) {
// Get arrays between top to bottom, this will return the array of array for selected data
Expand Down

0 comments on commit 3c46f08

Please sign in to comment.