This repository was archived by the owner on Oct 24, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ const reactivePropSetterMap = {
55 data : 'resetData' ,
66 columns : 'setColumns' ,
77 bodyHeight : 'setBodyHeight' ,
8- frozenColumnCount : 'setFrozenColumnCount'
8+ frozenColumnCount : 'setFrozenColumnCount' ,
9+ columnOptions : 'setFrozenColumnCount'
910} ;
1011
1112export default class Grid extends React . Component {
@@ -50,8 +51,15 @@ export default class Grid extends React.Component {
5051 ) ;
5152
5253 reactiveProps . forEach ( ( propName ) => {
53- const currentValue = this . props [ propName ] ;
54- const nextValue = nextProps [ propName ] ;
54+ let currentValue , nextValue ;
55+ if ( propName === 'columnOptions' && this . props . columnOptions ) {
56+ currentValue = this . props . columnOptions . frozenCount ;
57+ nextValue = nextProps . columnOptions . frozenCount ;
58+ } else {
59+ currentValue = this . props [ propName ] ;
60+ nextValue = nextProps [ propName ] ;
61+ }
62+
5563 if ( currentValue !== nextValue ) {
5664 const setterName = reactivePropSetterMap [ propName ] ;
5765 this . gridInst [ setterName ] ( nextValue ) ;
Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ stories.add('Events', () => {
120120stories . add ( 'Reactive Props' , ( ) => {
121121 const dataValue = object ( 'data' , data . slice ( 0 , 5 ) ) ;
122122 const columnsValue = object ( 'columns' , columns ) ;
123+ const columnOptions = object ( 'columnOptions' , { frozenCount : 2 } ) ;
123124 const bodyHeightValue = number ( 'bodyHeight' , 300 , {
124125 range : true ,
125126 min : 100 ,
@@ -137,6 +138,7 @@ stories.add('Reactive Props', () => {
137138 columns = { columnsValue }
138139 data = { dataValue }
139140 frozenColumnCount = { frozenColumnCountValue }
141+ columnOptions = { columnOptions }
140142 pagination = { false }
141143 bodyHeight = { bodyHeightValue }
142144 oneTimeBindingProps = { oneTimeBindingProps }
You can’t perform that action at this time.
0 commit comments