Skip to content

Commit

Permalink
feat: add onColumnsResizeDblClick event to adding new resize extras (#…
Browse files Browse the repository at this point in the history
…605)

- this new event will help in implementing a resize by cell content but only for the column that its resize was double-clicked (pretty much the same Excel)
  • Loading branch information
ghiscoding authored May 6, 2021
1 parent 28f44a3 commit d270367
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions slick.grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -1845,6 +1845,10 @@ if (typeof Slick === "undefined") {
render();
trigger(self.onColumnsResized, { triggeredByColumn: triggeredByColumn });
setTimeout(function () { columnResizeDragging = false; }, 300);
})
.on("dblclick", function () {
var triggeredByColumn = $(this).parent().attr("id").replace(uid, "");
trigger(self.onColumnsResizeDblClick, { triggeredByColumn: triggeredByColumn });
});
});
}
Expand Down Expand Up @@ -5913,6 +5917,7 @@ if (typeof Slick === "undefined") {
"onColumnsReordered": new Slick.Event(),
"onColumnsDrag": new Slick.Event(),
"onColumnsResized": new Slick.Event(),
"onColumnsResizeDblClick": new Slick.Event(),
"onBeforeColumnsResize": new Slick.Event(),
"onCellChange": new Slick.Event(),
"onCompositeEditorChange": new Slick.Event(),
Expand Down

0 comments on commit d270367

Please sign in to comment.