@@ -1128,6 +1128,9 @@ function _bindEvents(this: DrawGrid): void {
1128
1128
} ;
1129
1129
} ;
1130
1130
const canResizeColumn = ( col : number ) : boolean => {
1131
+ if ( grid [ _ ] . disableColumnResize ) {
1132
+ return false ;
1133
+ }
1131
1134
const limit = grid [ _ ] . colWidthsLimit [ col ] ;
1132
1135
if ( ! limit || ! limit . min || ! limit . max ) {
1133
1136
return true ;
@@ -2566,6 +2569,7 @@ interface DrawGridProtected {
2566
2569
font ?: string ;
2567
2570
underlayBackgroundColor ?: string ;
2568
2571
keyboardOptions ?: DrawGridKeyboardOptions ;
2572
+ disableColumnResize ?: boolean ;
2569
2573
2570
2574
rowHeightsMap : NumberMap < number > ;
2571
2575
colWidthsMap : NumberMap < string | number > ;
@@ -2623,6 +2627,10 @@ export interface DrawGridConstructorOptions {
2623
2627
* Canvas parent element
2624
2628
*/
2625
2629
parentElement ?: HTMLElement | null ;
2630
+ /**
2631
+ * Disable column resizing
2632
+ */
2633
+ disableColumnResize ?: boolean ;
2626
2634
}
2627
2635
const protectedKey = _ ;
2628
2636
/**
@@ -2647,7 +2655,8 @@ export abstract class DrawGrid extends EventTarget implements DrawGridAPI {
2647
2655
font,
2648
2656
underlayBackgroundColor,
2649
2657
keyboardOptions,
2650
- parentElement
2658
+ parentElement,
2659
+ disableColumnResize
2651
2660
} = options ;
2652
2661
const protectedSpace = ( this [ _ ] = { } as DrawGridProtected ) ;
2653
2662
style . initDocument ( ) ;
@@ -2678,6 +2687,7 @@ export abstract class DrawGrid extends EventTarget implements DrawGridAPI {
2678
2687
protectedSpace . underlayBackgroundColor = underlayBackgroundColor ;
2679
2688
2680
2689
protectedSpace . keyboardOptions = keyboardOptions ;
2690
+ protectedSpace . disableColumnResize = disableColumnResize ;
2681
2691
2682
2692
/////
2683
2693
protectedSpace . rowHeightsMap = new NumberMap ( ) ;
0 commit comments