Improve logic for Add Filter grid button/autocomplete
this should work for oruga as well as buefy
This commit is contained in:
		
							parent
							
								
									e030dc841d
								
							
						
					
					
						commit
						6bee65780c
					
				
					 2 changed files with 9 additions and 1 deletions
				
			
		|  | @ -294,6 +294,7 @@ | |||
|       computed: { | ||||
| 
 | ||||
|           addFilterChoices() { | ||||
|               // nb. this returns all choices available for "Add Filter" operation | ||||
| 
 | ||||
|               // collect all filters, which are *not* already shown | ||||
|               let choices = [] | ||||
|  | @ -354,6 +355,13 @@ | |||
| 
 | ||||
|       methods: { | ||||
| 
 | ||||
|           formatAddFilterItem(filtr) { | ||||
|               if (!filtr.key) { | ||||
|                   filtr = this.filters[filtr] | ||||
|               } | ||||
|               return filtr.label || filtr.key | ||||
|           }, | ||||
| 
 | ||||
|           % if grid.click_handlers: | ||||
|               cellClick(row, column, rowIndex, columnIndex) { | ||||
|                   % for key in grid.click_handlers: | ||||
|  |  | |||
|  | @ -32,7 +32,7 @@ | |||
|                     v-model="addFilterTerm" | ||||
|                     placeholder="Add Filter" | ||||
|                     field="key" | ||||
|                     :custom-formatter="filtr => filtr.label" | ||||
|                     :custom-formatter="formatAddFilterItem" | ||||
|                     open-on-focus | ||||
|                     keep-first | ||||
|                     icon-pack="fas" | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lance Edgar
						Lance Edgar