Multiselect dropdown in Vision

FYI I found another little bug that prevented toggling the "table header" off while in table mode.
In the "setDropdown" custom method, line 178.

The existing code:

	# Check to see if table mode is selected, and if so, display the table grid
	if multiSelectDropdown.tableMode:
		table.showGrid = True
		
		# Check if we should display the header based on the multiSelectDropdown's tableModeShowHeader custom property
		# If we should show the header, set its height to match the height of the textFilter.
		if multiSelectDropdown.tableModeShowHeader: 
			table.tableHeader.setPreferredSize(Dimension(table.tableHeader.preferredSize.width, textFilter.height))	

	# If table mode is not selected, hide the table grid and the table header
	else:
		table.showGrid = False
		table.tableHeader.setPreferredSize(Dimension(table.tableHeader.preferredSize.width, 0))
	

Needs the following else statement added as below:

	# Check to see if table mode is selected, and if so, display the table grid
	if multiSelectDropdown.tableMode:
		table.showGrid = True
		
		# Check if we should display the header based on the multiSelectDropdown's tableModeShowHeader custom property
		# If we should show the header, set its height to match the height of the textFilter.
		if multiSelectDropdown.tableModeShowHeader: 
			table.tableHeader.setPreferredSize(Dimension(table.tableHeader.preferredSize.width, textFilter.height))	
		else:
			# 23/04/2025 - rlee - added else statement to ensure 'tableModeShowHeader' is respected in both cases...
			table.tableHeader.setPreferredSize(Dimension(table.tableHeader.preferredSize.width, 0))
	# If table mode is not selected, hide the table grid and the table header
	else:
		table.showGrid = False
		table.tableHeader.setPreferredSize(Dimension(table.tableHeader.preferredSize.width, 0))
	

ON ANOTHER NOTE- Filtering all columns?

I'm having a bit of trouble trying to figure out why the filtering is not working for my current use case.
I've got 3 columns in the Data property, INT, STRING, STRING.

I am able to filter based on the first two columns (I believe - maybe its just working on the second TaskUUID column).
I've tested this by starting typing CT- or PT- and it filters accordingly. Also filters purely on numbers ie: 455**

But I can't seem to filter on the final "Description" column, by typing something like "grind" or "chain".

Any ideas why this may be?

I believe this filtering is handled by the custom method "showDropdown", in the function "setInternalData" ?

And it seems to loop through all columns to filter so not sure why it wouldn't work?

1 Like

Thanks

The multiselect dropdown is an adaptation of the Searchable Dropdown, which is why it has that cool filtering ability. The original version of the searchable dropdown didn't have a table mode, and it would display the 1st column if only one column were present or the second column if two or more columns were present. The displayed column is referred to in the code as the label column, and my filtering algorithm works off the resultant list of labels from that column. I don't believe it looks at the hidden value column at all.

At some point, somebody in the forum asked me to add a table mode, so I did because it seemed quite useful, but it simply didn't occur to me to expand the filtering logic to the other displayed columns.

Filtering on all columns is certainly doable, and it's obviously a useful improvement, but at this point, I'm not sure what the timeline would be for me to get it done, published, and approved. That said, I will look into this, and let you know how to do it when I figure it out, assuming you don't beat me to it.