@@ -16,6 +16,7 @@ import {
1616 IgrInput ,
1717 IgrInputModule ,
1818 IgrIconButtonModule ,
19+ registerIconFromText ,
1920} from "igniteui-react" ;
2021
2122const mods : any [ ] = [ IgrGridModule , IgrChipModule , IgrInputModule , IgrIconButtonModule ] ;
@@ -34,26 +35,16 @@ const data = new MarketData();
3435
3536export default function Sample ( ) {
3637 const gridRef = useRef < IgrGrid > ( null ) ;
37- const searchIconRef = useRef < IgrIconButton > ( null ) ;
38- const clearIconRef = useRef < IgrIconButton > ( null ) ;
39- const iconButtonNextRef = useRef < IgrIconButton > ( null ) ;
40- const iconButtonPrevRef = useRef < IgrIconButton > ( null ) ;
4138 const caseSensitiveChipRef = useRef < IgrChip > ( null ) ;
4239 const exactMatchChipRef = useRef < IgrChip > ( null ) ;
4340
4441 const [ searchText , setSearchText ] = useState ( '' ) ;
4542
4643 useEffect ( ( ) => {
47- if ( searchIconRef ?. current ) {
48- searchIconRef . current . registerIconFromText ( "search" , searchIconText , "material" ) ;
49- searchIconRef . current . registerIconFromText ( "clear" , clearIconText , "material" ) ;
50- }
51- if ( iconButtonPrevRef ?. current ) {
52- iconButtonPrevRef . current . registerIconFromText ( "prev" , prevIconText , "material" ) ;
53- }
54- if ( iconButtonNextRef ?. current ) {
55- iconButtonNextRef . current . registerIconFromText ( "next" , nextIconText , "material" ) ;
56- }
44+ registerIconFromText ( "search" , searchIconText , "material" ) ;
45+ registerIconFromText ( "clear" , clearIconText , "material" ) ;
46+ registerIconFromText ( "prev" , prevIconText , "material" ) ;
47+ registerIconFromText ( "next" , nextIconText , "material" ) ;
5748 } , [ ] ) ;
5849
5950 function handleOnSearchChange ( event : IgrComponentValueChangedEventArgs ) {
@@ -94,15 +85,13 @@ export default function Sample() {
9485 { searchText . length === 0 ? (
9586 < IgrIconButton
9687 key = "searchIcon"
97- ref = { searchIconRef }
9888 variant = "flat"
9989 name = "search"
10090 collection = "material"
10191 > </ IgrIconButton >
10292 ) : (
10393 < IgrIconButton
10494 key = "clearIcon"
105- ref = { clearIconRef }
10695 variant = "flat"
10796 name = "clear"
10897 collection = "material"
@@ -122,15 +111,13 @@ export default function Sample() {
122111 < div slot = "suffix" key = "buttonsSuffix" >
123112 < IgrIconButton
124113 key = "prevIconButton"
125- ref = { iconButtonPrevRef }
126114 variant = "flat"
127115 name = "prev"
128116 collection = "material"
129117 onClick = { prevSearch }
130118 > </ IgrIconButton >
131119 < IgrIconButton
132120 key = "nextIconButton"
133- ref = { iconButtonNextRef }
134121 variant = "flat"
135122 name = "next"
136123 collection = "material"
@@ -140,11 +127,11 @@ export default function Sample() {
140127 </ IgrInput >
141128 </ div >
142129 < IgrGrid className = "gridSize" ref = { gridRef } autoGenerate = { false } allowFiltering = { true } data = { data } height = "100%" width = "100%" >
143- < IgrColumn field = "IndustrySector" dataType = "string" sortable = { true } > </ IgrColumn >
144- < IgrColumn field = "IndustryGroup" dataType = "string" sortable = { true } > </ IgrColumn >
145- < IgrColumn field = "SectorType" dataType = "string" sortable = { true } > </ IgrColumn >
146- < IgrColumn field = "KRD" dataType = "number" sortable = { true } > </ IgrColumn >
147- < IgrColumn field = "MarketNotion" dataType = "number" sortable = { true } > </ IgrColumn >
130+ < IgrColumn field = "IndustrySector" dataType = "string" sortable = { true } > </ IgrColumn >
131+ < IgrColumn field = "IndustryGroup" dataType = "string" sortable = { true } > </ IgrColumn >
132+ < IgrColumn field = "SectorType" dataType = "string" sortable = { true } > </ IgrColumn >
133+ < IgrColumn field = "KRD" dataType = "number" sortable = { true } > </ IgrColumn >
134+ < IgrColumn field = "MarketNotion" dataType = "number" sortable = { true } > </ IgrColumn >
148135 </ IgrGrid >
149136 </ div >
150137 </ div >
0 commit comments