@@ -5,8 +5,8 @@ import './example07.scss';
55const Example7 : React . FC = ( ) => {
66 const [ gridOptions1 , setGridOptions1 ] = useState < GridOption | undefined > ( undefined ) ;
77 const [ gridOptions2 , setGridOptions2 ] = useState < GridOption | undefined > ( undefined ) ;
8- const [ columnDefinitions1 , setColumnDefinitions1 ] = useState < Column [ ] > ( [ ] ) ;
9- const [ columnDefinitions2 , setColumnDefinitions2 ] = useState < Column [ ] > ( [ ] ) ;
8+ const [ columns1 , setColumns1 ] = useState < Column [ ] > ( [ ] ) ;
9+ const [ columns2 , setColumns2 ] = useState < Column [ ] > ( [ ] ) ;
1010 const [ dataset1 , setDataset1 ] = useState < any [ ] > ( [ ] ) ;
1111 const [ dataset2 , setDataset2 ] = useState < any [ ] > ( [ ] ) ;
1212 const [ hideSubTitle , setHideSubTitle ] = useState ( false ) ;
@@ -65,13 +65,13 @@ const Example7: React.FC = () => {
6565 } ,
6666 } ) ;
6767
68- const columnDefinitions1 = createColumnDefinitions ( 1 ) ;
69- const columnDefinitions2 = createColumnDefinitions ( 2 ) ;
70- setColumnDefinitions1 ( columnDefinitions1 ) ;
71- setColumnDefinitions2 ( columnDefinitions2 ) ;
68+ const columns1 = createColumns ( 1 ) ;
69+ const columns2 = createColumns ( 2 ) ;
70+ setColumns1 ( columns1 ) ;
71+ setColumns2 ( columns2 ) ;
7272
73- setDataset1 ( loadData ( 200 , columnDefinitions1 ) ) ;
74- setDataset2 ( loadData ( 200 , columnDefinitions2 ) ) ;
73+ setDataset1 ( loadData ( 200 , columns1 ) ) ;
74+ setDataset2 ( loadData ( 200 , columns2 ) ) ;
7575 }
7676
7777 function handleOnCommand ( _e : SlickEventData , args : any , gridNo : 1 | 2 ) {
@@ -105,12 +105,12 @@ const Example7: React.FC = () => {
105105 }
106106 }
107107
108- function createColumnDefinitions ( gridNo : number ) {
108+ function createColumns ( gridNo : number ) {
109109 // Set up some test columns.
110- const columnDefinitions : any [ ] = [ ] ;
110+ const columns : any [ ] = [ ] ;
111111
112112 for ( let i = 0 ; i < 10 ; i ++ ) {
113- columnDefinitions . push ( {
113+ columns . push ( {
114114 id : i ,
115115 name : 'Column ' + String . fromCharCode ( 'A' . charCodeAt ( 0 ) + i ) ,
116116 field : i + '' ,
@@ -151,8 +151,8 @@ const Example7: React.FC = () => {
151151 }
152152
153153 // Set multiple buttons on the first column to demonstrate overflow.
154- columnDefinitions [ 0 ] . name = 'Resize me!' ;
155- columnDefinitions [ 0 ] . header = {
154+ columns [ 0 ] . name = 'Resize me!' ;
155+ columns [ 0 ] . header = {
156156 buttons : [
157157 {
158158 cssClass : 'mdi mdi-message-text' ,
@@ -183,12 +183,12 @@ const Example7: React.FC = () => {
183183
184184 // when floating to left, you might want to inverse the icon orders
185185 if ( gridNo === 2 ) {
186- columnDefinitions [ 0 ] . header ?. buttons ?. reverse ( ) ;
186+ columns [ 0 ] . header ?. buttons ?. reverse ( ) ;
187187 }
188188
189189 // Set a button on the second column to demonstrate hover.
190- columnDefinitions [ 1 ] . name = 'Hover me!' ;
191- columnDefinitions [ 1 ] . header = {
190+ columns [ 1 ] . name = 'Hover me!' ;
191+ columns [ 1 ] . header = {
192192 buttons : [
193193 {
194194 cssClass : 'mdi mdi-help-circle' ,
@@ -201,17 +201,17 @@ const Example7: React.FC = () => {
201201 ] ,
202202 } ;
203203
204- return columnDefinitions ;
204+ return columns ;
205205 }
206206
207- function loadData ( count : number , columnDefinitions : Column [ ] ) {
207+ function loadData ( count : number , columns : Column [ ] ) {
208208 // mock a dataset
209209 const mockDataset : any [ ] = [ ] ;
210210
211211 for ( let i = 0 ; i < count ; i ++ ) {
212212 const d : any = ( mockDataset [ i ] = { } ) ;
213213 d [ 'id' ] = i ;
214- for ( let j = 0 ; j < columnDefinitions . length ; j ++ ) {
214+ for ( let j = 0 ; j < columns . length ; j ++ ) {
215215 d [ j ] = Math . round ( Math . random ( ) * 10 ) - 5 ;
216216 }
217217 }
@@ -270,7 +270,7 @@ const Example7: React.FC = () => {
270270 < h5 > Grid 1</ h5 >
271271 < SlickgridReact
272272 gridId = "grid7-1"
273- columns = { columnDefinitions1 }
273+ columns = { columns1 }
274274 options = { gridOptions1 }
275275 dataset = { dataset1 }
276276 onReactGridCreated = { ( $event ) => reactGrid1Ready ( $event . detail ) }
@@ -283,7 +283,7 @@ const Example7: React.FC = () => {
283283 </ h5 >
284284 < SlickgridReact
285285 gridId = "grid7-2"
286- columns = { columnDefinitions2 }
286+ columns = { columns2 }
287287 options = { gridOptions2 }
288288 dataset = { dataset2 }
289289 onReactGridCreated = { ( $event ) => reactGrid2Ready ( $event . detail ) }
0 commit comments