docs(changeset): Added searchfields
This commit is contained in:
		
							parent
							
								
									5fc02f9671
								
							
						
					
					
						commit
						864188c599
					
				
							
								
								
									
										5
									
								
								.changeset/cuddly-groups-bake.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								.changeset/cuddly-groups-bake.md
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,5 @@ | |||||||
|  | --- | ||||||
|  | '@warkypublic/oranguru': patch | ||||||
|  | --- | ||||||
|  | 
 | ||||||
|  | Added searchfields | ||||||
| @ -90,6 +90,7 @@ export interface GridlerProps extends PropsWithChildren { | |||||||
| 
 | 
 | ||||||
|   rowHeight?: number; |   rowHeight?: number; | ||||||
|   scrollToRowKey?: number; |   scrollToRowKey?: number; | ||||||
|  |   searchFields?: Array<string>; | ||||||
|   searchStr?: string; |   searchStr?: string; | ||||||
|   sections?: { |   sections?: { | ||||||
|     bottom?: React.ReactNode; |     bottom?: React.ReactNode; | ||||||
|  | |||||||
| @ -35,6 +35,7 @@ function _GlidlerAPIAdaptorForGoLangv2<T = unknown>(props: GlidlerAPIAdaptorForG | |||||||
|       const pageSize = getState('pageSize'); |       const pageSize = getState('pageSize'); | ||||||
|       const colFilters = getState('colFilters'); |       const colFilters = getState('colFilters'); | ||||||
|       const searchStr = getState('searchStr'); |       const searchStr = getState('searchStr'); | ||||||
|  |       const searchFields = getState('searchFields'); | ||||||
|       const _active_requests = getState('_active_requests'); |       const _active_requests = getState('_active_requests'); | ||||||
|       setState('loadingData', true); |       setState('loadingData', true); | ||||||
|       try { |       try { | ||||||
| @ -72,7 +73,12 @@ function _GlidlerAPIAdaptorForGoLangv2<T = unknown>(props: GlidlerAPIAdaptorForG | |||||||
| 
 | 
 | ||||||
|           if (searchStr && searchStr !== '') { |           if (searchStr && searchStr !== '') { | ||||||
|             columns |             columns | ||||||
|               ?.filter((f) => !f.disableFilter && !f.disableSearch) |               ?.filter( | ||||||
|  |                 (f) => | ||||||
|  |                   !f.disableFilter && | ||||||
|  |                   !f.disableSearch && | ||||||
|  |                   ((searchFields ?? []).length == 0 || searchFields?.includes(f.id)) | ||||||
|  |               ) | ||||||
|               ?.forEach((filter: any) => { |               ?.forEach((filter: any) => { | ||||||
|                 ops.push({ |                 ops.push({ | ||||||
|                   name: `${filter.id}`, |                   name: `${filter.id}`, | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user